Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-9064

HibernateNativeAPINaturalIdTestCase fails with security manager

XMLWordPrintable

    • Hide

      cd wildfly/testsuite/integration/basic
      mvn clean test -Dtest=HibernateNativeAPINaturalIdTestCase -Dsecurity.manager

      Show
      cd wildfly/testsuite/integration/basic mvn clean test -Dtest=HibernateNativeAPINaturalIdTestCase -Dsecurity.manager

      HibernateNativeAPINaturalIdTestCase fails with security manager because of missing permission "("java.lang.RuntimePermission" "createClassLoader")":

      javax.ejb.EJBException: java.lang.RuntimeException: Could not setup config
      	at org.jboss.as.ejb3.tx.BMTInterceptor.handleException(BMTInterceptor.java:83)
      	at org.jboss.as.ejb3.tx.StatefulBMTInterceptor.handleInvocation(StatefulBMTInterceptor.java:96)
      ...
      Caused by: java.lang.RuntimeException: Could not setup config
      	at org.jboss.as.test.integration.hibernate.naturalid.SFSBHibernateSFNaturalId.setupConfig(SFSBHibernateSFNaturalId.java:69)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ...
      Caused by: java.security.AccessControlException: WFSM000001: Permission check failed (permission "("java.lang.RuntimePermission" "createClassLoader")" in code source "(vfs:/content/hibernate4naturalid_test.ear/beans.jar <no signer certificates>)" of "ModuleClassLoader for Module "deployment.hibernate4naturalid_test.ear.beans.jar" from Service Module Loader")
      	at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:278)
      	at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:175)
      	at java.lang.SecurityManager.checkCreateClassLoader(SecurityManager.java:611)
      	at org.wildfly.security.manager.WildFlySecurityManager.checkCreateClassLoader(WildFlySecurityManager.java:308)
      ...
      

      After adding the permission, there is another missing permission "("java.io.FilePermission" "/home/okotek/git/wildfly/dist/target/wildfly-11.0.0.Beta1-SNAPSHOT/modules/system/layers/base/org/hibernate/main/hibernate-envers-5.1.8.Final.jar" "read")". A privileged section is missing probably.

            Unassigned Unassigned
            okotek@redhat.com Ondrej Kotek
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: