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

Hibernate tests failures with security manager

XMLWordPrintable

    • Hide

      cd wildfly/testsuite/compat
      mvn clean test -Dtest=VerifyHibernate51CompatibilityJDSEnabledTransformerTestCase -Dsecurity.manager

      Show
      cd wildfly/testsuite/compat mvn clean test -Dtest=VerifyHibernate51CompatibilityJDSEnabledTransformerTestCase -Dsecurity.manager

      As a limitation documented by JBEAP-15368 there is lot of tests (approximately 75) using hibernate that are failing with security manager. E.g in package

      • org.jboss.as.test.compat.jpa.hibernate.transformer
      • org.jboss.as.test.integration.hibernate
      • org.jboss.as.test.integration.hibernate.envers

      This failure contains exception like this

      Caused by: java.security.AccessControlException: WFSM000001: Permission check failed (permission "("java.io.FilePermission" "/store/repository/org/hibernate/hibernate-envers/5.3.7.Final/hibernate-envers-5.3.7.Final.jar" "read")" in code source "(vfs:/content/org.jboss.as.test.compat.jpa.hibernate.transformer.VerifyHibernate51CompatibilityJDSEnabledTransformerTestCase.ear/main.war/WEB-INF/classes <no signer certificates>)" of "ModuleClassLoader for Module "deployment.org.jboss.as.test.compat.jpa.hibernate.transformer.VerifyHibernate51CompatibilityJDSEnabledTransformerTestCase.ear.main.war" from Service Module Loader")
      	at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:294)
      	at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:191)
      	at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
      	at org.wildfly.security.manager.WildFlySecurityManager.checkRead(WildFlySecurityManager.java:359)
      	at sun.net.www.protocol.jar.JarFileFactory.getCachedJarFile(JarFileFactory.java:137)
      	at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:81)
      	at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
      	at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:152)
      	at java.net.URL.openStream(URL.java:1045)
      	at java.util.ServiceLoader.parse(ServiceLoader.java:304)
      	at java.util.ServiceLoader.access$200(ServiceLoader.java:185)
      	at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:357)
      	at java.util.ServiceLoader$LazyIterator.access$600(ServiceLoader.java:323)
      	at java.util.ServiceLoader$LazyIterator$1.run(ServiceLoader.java:396)
      	at java.util.ServiceLoader$LazyIterator$1.run(ServiceLoader.java:395)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:398)
      	at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
      	at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:465)
      	at org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(IntegratorServiceImpl.java:40)
      	at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:224)
      	at org.hibernate.cfg.Configuration.<init>(Configuration.java:118)
      	at org.jboss.as.test.compat.jpa.hibernate.transformer.SFSBHibernateSessionFactory.setupConfig(SFSBHibernateSessionFactory.java:66)
      

      Is there way to workaround this limitation in testsuite?

      [1] https://ci.wildfly.org/viewLog.html?buildId=128138&buildTypeId=WF_MasterSecurityManager

            istudens@redhat.com Ivo Studensky
            mchoma@redhat.com Martin Choma
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: