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

Test ClassFileTransformerTestCase fails with security manager

    • Hide
      cd wildfly/testsuite/integration/basic
      mvn clean test -Dtest=ClassFileTransformerTestCase -Dsecurity.manager -DtestLogToFile=false
      
      Show
      cd wildfly/testsuite/integration/basic mvn clean test -Dtest=ClassFileTransformerTestCase -Dsecurity.manager -DtestLogToFile=false

      org.jboss.as.test.integration.jpa.mockprovider.classtransformer (1)
          ClassFileTransformerTestCase.test_persistenceUnitInfoURLS 
      
      java.security.AccessControlException: WFSM000001: Permission check failed (permission "("org.jboss.vfs.VirtualFilePermission" "/content/jpa_classTransformerTestWithMockProvider.ear/ejbjar.jar" "read")" in code source "(vfs:/content/jpa_classTransformerTestWithMockProvider.ear/lib/lib.jar <no signer certificates>)" of "ModuleClassLoader for Module "deployment.jpa_classTransformerTestWithMockProvider.ear" 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 org.jboss.vfs.VirtualFile.openStream(VirtualFile.java:303)
      	at org.jboss.vfs.protocol.VirtualFileURLConnection.getInputStream(VirtualFileURLConnection.java:65)
      	at java.net.URL.openStream(URL.java:1045)
      	at org.jboss.as.test.integration.jpa.mockprovider.classtransformer.ClassFileTransformerTestCase.test_persistenceUnitInfoURLS(ClassFileTransformerTestCase.java:117)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.jboss.arquillian.junit.Arquillian$8$1.invoke(Arquillian.java:379)
      	at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)
      	at sun.reflect.GeneratedMethodAccessor354.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:85)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:143)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
      	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
      	at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38)
      	at sun.reflect.GeneratedMethodAccessor353.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:85)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:130)
      	at sun.reflect.GeneratedMethodAccessor326.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:92)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)
      	at sun.reflect.GeneratedMethodAccessor325.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:92)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)
      	at sun.reflect.GeneratedMethodAccessor324.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:92)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:143)
      	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:136)
      	at org.jboss.arquillian.junit.Arquillian$8.evaluate(Arquillian.java:372)
      	at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:246)
      	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:431)
      	at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:55)
      	at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:260)
      	at org.jboss.arquillian.junit.Arquillian$7$1.invoke(Arquillian.java:324)
      	at org.jboss.arquillian.container.test.impl.execution.BeforeLifecycleEventExecuter.on(BeforeLifecycleEventExecuter.java:35)
      	at sun.reflect.GeneratedMethodAccessor327.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:85)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:130)
      	at sun.reflect.GeneratedMethodAccessor326.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:92)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)
      	at sun.reflect.GeneratedMethodAccessor325.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:92)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)
      	at sun.reflect.GeneratedMethodAccessor324.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:92)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:143)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
      	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.fireCustomLifecycle(EventTestRunnerAdaptor.java:159)
      	at org.jboss.arquillian.junit.Arquillian$7.evaluate(Arquillian.java:317)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:205)
      	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:431)
      	at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:55)
      	at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:219)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:167)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
      	at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:66)
      	at org.jboss.arquillian.protocol.jmx.JMXTestRunner.doRunTestMethod(JMXTestRunner.java:180)
      	at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.doRunTestMethod(ArquillianService.java:200)
      	at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:162)
      	at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:141)
      	at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:176)
      	at sun.reflect.GeneratedMethodAccessor343.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
      	at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
      	at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112)
      	at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46)
      	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
      	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
      	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
      	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
      	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
      	at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:1475)
      	at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:724)
      	at org.jboss.as.jmx.BlockingNotificationMBeanServer.invoke(BlockingNotificationMBeanServer.java:168)
      	at org.jboss.as.jmx.AuthorizingMBeanServer.invoke(AuthorizingMBeanServer.java:258)
      	at org.jboss.remotingjmx.protocol.v2.ServerProxy$InvokeHandler.handle(ServerProxy.java:950)
      	at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1$1.run(ServerCommon.java:153)
      	at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:71)
      	at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:66)
      	at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:313)
      	at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:270)
      	at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:254)
      	at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:225)
      	at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor.handleEvent(ServerInterceptorFactory.java:66)
      	at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:149)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

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

            [WFLY-11359] Test ClassFileTransformerTestCase fails with security manager

            The PR was for fixing the tests only. Placing this back to the Open status.

            James Perkins added a comment - The PR was for fixing the tests only. Placing this back to the Open status.

            It looks like WFLY-11555 did not fix the issue. This does seem to indicate some kind of odd condition somewhere as it does pass sometimes.

            James Perkins added a comment - It looks like WFLY-11555 did not fix the issue. This does seem to indicate some kind of odd condition somewhere as it does pass sometimes.

            It's possible this will be fixed in WFLY-11555 since it's intermittent.

            James Perkins added a comment - It's possible this will be fixed in WFLY-11555 since it's intermittent.

            AFAIK we dont have such ignoring mechanism for security manager. But if it is as you say it will be safe to add permission for deployment. Most difficult about this issues like this is to decide if adding permission to deployment is correct or doPriviledged block is missing somewhere in server code.

            Martin Choma added a comment - AFAIK we dont have such ignoring mechanism for security manager. But if it is as you say it will be safe to add permission for deployment. Most difficult about this issues like this is to decide if adding permission to deployment is correct or doPriviledged block is missing somewhere in server code.

            mchoma@redhat.com The org.jboss.as.test.integration.jpa.mockprovider.classtransformer.ClassFileTransformerTestCase is testing a "mock" persistence provider class that is not included in the WildFly distribution. I think its best to exclude this test from being tested with the Java security manager for that reason. What is the current way to exclude org.jboss.as.test.integration.jpa.mockprovider.classtransformer.ClassFileTransformerTestCase from security manager testing?

            Scott Marlow added a comment - mchoma@redhat.com The org.jboss.as.test.integration.jpa.mockprovider.classtransformer.ClassFileTransformerTestCase is testing a "mock" persistence provider class that is not included in the WildFly distribution. I think its best to exclude this test from being tested with the Java security manager for that reason. What is the current way to exclude org.jboss.as.test.integration.jpa.mockprovider.classtransformer.ClassFileTransformerTestCase from security manager testing?

            Martin Choma added a comment - - edited

            smarlow@redhat.com writing to you as lead of JPA / Hibernate [1]. Could you assignee this issue to someone.

            [1] https://issues.jboss.org/projects/WFLY?selectedItem=com.atlassian.jira.jira-projects-plugin:components-page

            Martin Choma added a comment - - edited smarlow@redhat.com writing to you as lead of JPA / Hibernate [1] . Could you assignee this issue to someone. [1] https://issues.jboss.org/projects/WFLY?selectedItem=com.atlassian.jira.jira-projects-plugin:components-page

              smarlow1@redhat.com Scott Marlow
              mchoma@redhat.com Martin Choma
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: