diff --git a/src-test/src/org/openbravo/test/security/AccessLevelTest.java b/src-test/src/org/openbravo/test/security/AccessLevelTest.java
index c71df9b9e6..cda2d3cec0 100644
--- a/src-test/src/org/openbravo/test/security/AccessLevelTest.java
+++ b/src-test/src/org/openbravo/test/security/AccessLevelTest.java
@@ -127,7 +127,7 @@ public class AccessLevelTest extends OBBaseTest {
     final Client clientZero = OBDal.getInstance().get(Client.class, "0");
     final Organization orgZero = OBDal.getInstance().get(Organization.class, "0");
     for (Entity e : entities) {
-      if (e.isDataSourceBased() || e.isHQLBased()) {
+      if (e.isDataSourceBased() || e.isHQLBased() || e.isView()) {
         // The entity is not associated with a database table, so it does not apply
         continue;
       }
@@ -177,18 +177,22 @@ public class AccessLevelTest extends OBBaseTest {
       final OBQuery<BaseOBObject> obq = OBDal.getInstance()
           .createQuery(e.getName(), where.toString());
       obq.setNamedParameters(params);
-      for (BaseOBObject bob : obq.list()) {
-        String clientId = null;
-        if (bob instanceof ClientEnabled) {
-          clientId = ((ClientEnabled) bob).getClient().getId();
-        }
-        String orgId = null;
-        if (bob instanceof OrganizationEnabled) {
-          orgId = ((OrganizationEnabled) bob).getOrganization().getId();
+      try {
+        for (BaseOBObject bob : obq.list()) {
+          String clientId = null;
+          if (bob instanceof ClientEnabled) {
+            clientId = ((ClientEnabled) bob).getClient().getId();
+          }
+          String orgId = null;
+          if (bob instanceof OrganizationEnabled) {
+            orgId = ((OrganizationEnabled) bob).getOrganization().getId();
+          }
+          sb.append("Object " + bob.getIdentifier() + " (" + bob.getEntityName()
+              + ") has an invalid client/org " + clientId + "/" + orgId
+              + " for the accesslevel of the entity/table: " + e.getAccessLevel().name() + ".\n");
         }
-        sb.append("Object " + bob.getIdentifier() + " (" + bob.getEntityName()
-            + ") has an invalid client/org " + clientId + "/" + orgId
-            + " for the accesslevel of the entity/table: " + e.getAccessLevel().name() + ".\n");
+      } catch (Exception ex) {
+        throw new OBException("Exception while testing entity: " + e, ex);
       }
     }
     if (sb.length() > 0) {
