-
Bug
-
Resolution: Done
-
Major
-
None
Proactively assigning to ochaloup@redhat.com as he is the original test author; feel free to adjust as necessary.
org.jboss.as.test.integration.transaction.inflow.TransactionInflowTestCase does not function correctly under a security manager. The stack trace is like this:
Breakpoint reached at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:295) at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:192) at java.lang.SecurityManager.checkConnect(SecurityManager.java:1048) at org.wildfly.security.manager.WildFlySecurityManager.checkConnect(WildFlySecurityManager.java:390) at java.net.InetAddress.getLocalHost(InetAddress.java:1477) at org.jboss.as.test.integration.transaction.inflow.TransactionInflowXid.getXid(TransactionInflowXid.java:128) at org.jboss.as.test.integration.transaction.inflow.TransactionInflowXid.getUniqueXid(TransactionInflowXid.java:102) at org.jboss.as.test.integration.transaction.inflow.TransactionInflowResourceAdapter.endpointActivation(TransactionInflowResourceAdapter.java:65) at org.jboss.jca.core.rar.EndpointImpl.activate(EndpointImpl.java:194) at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.activate(MessageDrivenComponent.java:277) at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:235) at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378) at java.lang.Thread.run(Thread.java:748) at org.jboss.threads.JBossThread.run(JBossThread.java:485) Perm = ("java.net.SocketPermission" "behemoth.local" "resolve"), CS = (vfs:/content/inflow-txn-ra.rar/inflow-txn-inside.jar <no signer certificates>), CL = ModuleClassLoader for Module "deployment.inflow-txn-ra.rar" from Service Module Loader, ID = 824b419
The cause is that org.jboss.as.test.integration.transaction.inflow.TransactionInflowXid#getXid calls java.net.InetAddress#getLocalHost which requires a security manager permission. If the permission is denied (which it always is when running under a security manager), then it falls back through a catch (Exception ex) to a bogus IP address of "1.2.3.4".
For correct operation, the test archives which use this method should have the "*" "resolve" SocketPermission granted to them.