Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-18949

JMS queue and topic don't work correctly once broadcast-group and discovery-group is used on IPv6 && localhost

    Details

    • Type: Bug
    • Status: New (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.2.0.GA, 7.3.0.GA.CR4, 7.4.0.CD19
    • Fix Version/s: None
    • Component/s: JMS
    • Labels:
      None

      Description

      JMS queue and topic don't work correctly once broadcast-group and discovery-group is used on IPv6 && localhost.

      Steps to reproduce:

      1. start server with IPv6:
        • sed -i "s/preferIPv4Stack=true/preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true/g" standalone.conf
        • ./standalone.sh -Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true -Djboss.bind.address=::1 -Djboss.bind.address.management=::1 -c standalone-full.xml
      2. configure queue and topic
        • ./jboss-cli.sh -c --controller=remote+http://[::1]:9990
        • reload --start-mode=admin-only
          /subsystem=messaging-activemq/server=default/jms-queue=myQueue:add(entries=[/queue/myQueue])
          /subsystem=messaging-activemq/server=default/jms-topic=myTopic:add(entries=[/topic/myTopic])
          /socket-binding-group=standard-sockets/socket-binding=messaging-group:add(multicast-address=ff13::1,multicast-port="${jboss.messaging.group.port:45700}")
          /subsystem=messaging-activemq/socket-discovery-group=dg1:add(socket-binding=messaging-group,initial-wait-timeout=30000)
          /subsystem=messaging-activemq/server=default/pooled-connection-factory=activemq-ra:remove()
          /subsystem=messaging-activemq/server=default/socket-broadcast-group=bg-group1:add(socket-binding=messaging-group,connectors=[http-connector])
          /subsystem=messaging-activemq/server=default/socket-discovery-group=dg-group1:add(socket-binding=messaging-group)
          /subsystem=messaging-activemq/server=default/cluster-connection=my-cluster:add(cluster-connection-address=jms,connector-name=http-connector, discovery-group=dg-group1)
          /subsystem=messaging-activemq/pooled-connection-factory=remote-artemis:add(transaction=xa, entries=["java:/JmsXA java:jboss/DefaultJMSConnectionFactory"], discovery-group=dg1)
          /subsystem=messaging-activemq/external-jms-topic=myTopic:add(entries=["java:/jms/DependentMessagingDeploymentTestCase/myTopic","/topic/myAwesomeClientTopic"])
          /subsystem=messaging-activemq/external-jms-queue=myQueue:add(entries=["java:/jms/DependentMessagingDeploymentTestCase/myQueue","/topic/myAwesomeClientQueue"])
          reload --start-mode=normal
          
      3. deploy deployment (see attached file single-application.zip )
        • ./jboss-cli.sh -c --controller=remote+http://[::1]:9990
        • deploy -f /home/mkopecky/erase3/single-application/target/custom-application.war
      4. add application user
        • ./add-user.sh -s -a -g guest -u guest -p guest
      5. http request
        • curl -v -X GET "http://[::1]:8080/custom-application/ClientMessagingDeploymentTestCase?destination=queue&text=056a94b3-19a3-49fd-8c56-4d6fdd460ed0"
        • curl -v -X GET "http://[::1]:8080/custom-application/ClientMessagingDeploymentTestCase?destination=topic&text=056a94b3-19a3-49fd-8c56-4d6fdd460ed0"

      Results

      • HTTP/1.1 500 Internal Server Error
      • 10:21:11,071 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /custom-application/ClientMessagingDeploymentTestCase: javax.jms.JMSRuntimeException: Failed to create session factory
        	at org.apache.activemq.artemis.ra.ActiveMQRAConnectionFactoryImpl.createContext(ActiveMQRAConnectionFactoryImpl.java:437)
        	at org.wildfly.extension.messaging.activemq.deployment.injection.AbstractJMSContext.createContext(AbstractJMSContext.java:63)
        	at org.wildfly.extension.messaging.activemq.deployment.injection.AbstractJMSContext.getContext(AbstractJMSContext.java:48)
        	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.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38)
        	at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:106)
        	at org.wildfly.extension.messaging.activemq.deployment.injection.RequestedJMSContext$Proxy$_$$_WeldClientProxy.getContext(Unknown Source)
        	at org.wildfly.extension.messaging.activemq.deployment.injection.InjectedJMSContext.getDelegate(InjectedJMSContext.java:92)
        	at org.wildfly.extension.messaging.activemq.deployment.injection.JMSContextWrapper.createTemporaryQueue(JMSContextWrapper.java:252)
        	at org.jboss.test.MessagingServlet.sendAndReceiveMessage(MessagingServlet.java:75)
        	at org.jboss.test.MessagingServlet.doGet(MessagingServlet.java:70)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:503)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
        	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
        	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
        	at io.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:52)
        	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
        	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
        	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
        	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
        	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
        	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        	at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
        	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
        	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
        	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
        	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
        	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
        	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
        	at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
        	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
        	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
        	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        	at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
        	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269)
        	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78)
        	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133)
        	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130)
        	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
        	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
        	at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
        	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
        	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
        	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
        	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
        	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)
        	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78)
        	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99)
        	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376)
        	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
        	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
        	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1348)
        	at java.lang.Thread.run(Thread.java:748)
        Caused by: javax.jms.JMSException: Failed to create session factory
        	at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:886)
        	at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createXAConnection(ActiveMQConnectionFactory.java:372)
        	at org.apache.activemq.artemis.ra.ActiveMQRAManagedConnection.setup(ActiveMQRAManagedConnection.java:766)
        	at org.apache.activemq.artemis.ra.ActiveMQRAManagedConnection.<init>(ActiveMQRAManagedConnection.java:161)
        	at org.apache.activemq.artemis.ra.ActiveMQRAManagedConnectionFactory.createManagedConnection(ActiveMQRAManagedConnectionFactory.java:147)
        	at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1326)
        	at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.getConnection(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:499)
        	at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:632)
        	at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:604)
        	at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:624)
        	at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:440)
        	at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:789)
        	at org.apache.activemq.artemis.ra.ActiveMQRASessionFactoryImpl.allocateConnection(ActiveMQRASessionFactoryImpl.java:867)
        	at org.apache.activemq.artemis.ra.ActiveMQRASessionFactoryImpl.createSession(ActiveMQRASessionFactoryImpl.java:526)
        	at org.apache.activemq.artemis.ra.ActiveMQRASessionFactoryImpl.createSession(ActiveMQRASessionFactoryImpl.java:741)
        	at org.apache.activemq.artemis.ra.ActiveMQRASessionFactoryImpl.createSession(ActiveMQRASessionFactoryImpl.java:746)
        	at org.apache.activemq.artemis.ra.ActiveMQRAConnectionFactoryImpl.validateUser(ActiveMQRAConnectionFactoryImpl.java:474)
        	at org.apache.activemq.artemis.ra.ActiveMQRAConnectionFactoryImpl.createContext(ActiveMQRAConnectionFactoryImpl.java:431)
        	... 62 more
        Caused by: ActiveMQConnectionTimedOutException[errorType=CONNECTION_TIMEDOUT message=AMQ219012: Timed out waiting to receive initial broadcast from cluster]
        	at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:778)
        	at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:884)
        	... 79 more
        

      Additional information

      • workaround: use non-localhost IP adress
      • This functional bug cause error of DiscoveryGroupExternalMessagingDeploymentTestCase test in WF TS.
      • this is not a regression against EAP 7.2.0.GA, alghough the EAP 7.2.0.GA has slightly different configuration (because of this commit)
        • reload --start-mode=admin-only
          /subsystem=messaging-activemq/server=default/jms-queue=myQueue:add(entries=[/queue/myQueue])
          /subsystem=messaging-activemq/server=default/jms-topic=myTopic:add(entries=[/topic/myTopic])
          /socket-binding-group=standard-sockets/socket-binding=messaging-group:add(multicast-address=ff13::1,multicast-port="${jboss.messaging.group.port:45700}")
          /subsystem=messaging-activemq/discovery-group=dg1:add(socket-binding=messaging-group,initial-wait-timeout=30000)
          /subsystem=messaging-activemq/server=default/pooled-connection-factory=activemq-ra:remove()
          /subsystem=messaging-activemq/server=default/broadcast-group=bg-group1:add(socket-binding=messaging-group,connectors=[http-connector])
          /subsystem=messaging-activemq/server=default/discovery-group=dg-group1:add(socket-binding=messaging-group)
          /subsystem=messaging-activemq/server=default/cluster-connection=my-cluster:add(cluster-connection-address=jms,connector-name=http-connector, discovery-group=dg-group1)
          /subsystem=messaging-activemq/pooled-connection-factory=remote-artemis:add(transaction=xa, entries=["java:/JmsXA java:jboss/DefaultJMSConnectionFactory"], discovery-group=dg1)
          /subsystem=messaging-activemq/external-jms-topic=myTopic:add(entries=["java:/jms/DependentMessagingDeploymentTestCase/myTopic","/topic/myAwesomeClientTopic"])
          /subsystem=messaging-activemq/external-jms-queue=myQueue:add(entries=["java:/jms/DependentMessagingDeploymentTestCase/myQueue","/topic/myAwesomeClientQueue"])
          reload --start-mode=normal
          

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ehugonnet Emmanuel Hugonnet
                Reporter:
                mkopecky Marek Kopecky
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: