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

Tests from org.jboss.as.test.integration.messaging fails with security manager

    Details

    • Steps to Reproduce:
      Hide

      cd wildfly/testsuite/integration/basic
      mvn clean test -Dtest=DiscoveryGroupExternalMessagingDeploymentTestCase -Dsecurity.manager -DtestLogToFile=false

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

      Description

      org.jboss.as.test.integration.messaging.jms.external (8)
          DiscoveryGroupExternalMessagingDeploymentTestCase.testSendMessageInClientQueue  	
          DiscoveryGroupExternalMessagingDeploymentTestCase.testSendMessageInClientTopic  	
          ExternalMessagingDeploymentRemoteTestCase.testSendMessageInClientQueue  	
          ExternalMessagingDeploymentRemoteTestCase.testSendMessageInClientTopic  	
          ExternalMessagingDeploymentTestCase.testSendMessageInClientQueue  	
          ExternalMessagingDeploymentTestCase.testSendMessageInClientTopic  	
          SendToExternalJMSQueueTestCase.sendMessage  	
          SendToExternalJMSTopicTestCase.sendMessage 
      org.jboss.as.test.integration.messaging.jms.context.notClosingInjectedContext (1)
          NotClosingInjectedContextTestCase.testLeakingConnection
      org.jboss.as.test.integration.messaging.jms.definitions (3)
          JMSResourceDefinitionsTestCase.testAnnotationBasedDefinitionsWithVaultedAttributes  	
          JMSResourceDefinitionsTestCase.testDeploymendDescriptorBasedDefinitionsWithVaultedAttributes  	
          JMSResourceDefinitionsTestCase.testInjectedDefinitions 
      org.jboss.as.test.integration.messaging.mgmt (1)
          ExternalPooledConnectionFactoryStatisticsTestCase.testStatistics 
      

      Check if it is enough to add permission to deployment or doPrivileged block is necessary somewhere. There are erros like this

      &amp#27;[33m00:17:58,191 WARN  [org.apache.activemq.artemis.core.client] (default task-1) AMQ212007: connector.create or connectorFactory.createConnector should never throw an exception, implementation is badly behaved, but we will deal with it anyway.: java.security.AccessControlException: WFSM000001: Permission check failed (permission "("java.net.SocketPermission" "localhost" "resolve")" in code source "(vfs:/content/ClientMessagingDeploymentTestCase.war/WEB-INF/classes <no signer certificates>)" of "ModuleClassLoader for Module "deployment.ClientMessagingDeploymentTestCase.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.checkConnect(SecurityManager.java:1048)
      	at org.wildfly.security.manager.WildFlySecurityManager.checkConnect(WildFlySecurityManager.java:389)
      	at java.net.InetAddress.getAllByName0(InetAddress.java:1268)
      	at java.net.InetAddress.getAllByName(InetAddress.java:1192)
      	at java.net.InetAddress.getAllByName(InetAddress.java:1126)
      	at java.net.InetAddress.getByName(InetAddress.java:1076)
      	at java.net.InetSocketAddress.<init>(InetSocketAddress.java:220)
      	at org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector.createConnection(NettyConnector.java:711)
      
      
      Caused by: java.security.AccessControlException: WFSM000001: Permission check failed (permission "("java.net.SocketPermission" "localhost:45700" "listen,resolve")" in code source "(vfs:/content/ClientMessagingDeploymentTestCase.war/WEB-INF/classes &lt;no signer certificates&gt;)" of "ModuleClassLoader for Module "deployment.ClientMessagingDeploymentTestCase.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.checkListen(SecurityManager.java:1131)
      	at org.wildfly.security.manager.WildFlySecurityManager.checkListen(WildFlySecurityManager.java:401)
      	at java.net.DatagramSocket.bind(DatagramSocket.java:389)
      	at java.net.MulticastSocket.&lt;init&gt;(MulticastSocket.java:172)
      	at org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory$UDPBroadcastEndpoint.openClient(UDPBroadcastEndpointFactory.java:203)
      	at org.apache.activemq.artemis.core.cluster.DiscoveryGroup.start(DiscoveryGroup.java:105)
      	at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.initialize(ServerLocatorImpl.java:309)
      

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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ehugonnet Emmanuel Hugonnet
                  Reporter:
                  mchoma Martin Choma
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: