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

[GSS](7.2.z) Standalone JMS Client repeats throwing NPE when using Artemis Core API for JGroups Dynamic Discovery

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • None
    • 7.1.0.CR1
    • ActiveMQ, JMS
    • Hide
      1. Execute add-user.sh to create a JMS user
        ./bin/add-user.sh -a -u 'test' -p 'test@123' -g 'guest'
        
      2. Start JBoss EAP 7.1.0 with standalone-full-ha.xml
      3. Execute jboss-cli to create a JMS Queue
        jms-queue add --queue-address=testQueue --entries=queue/test,java:jboss/exported/jms/queue/testQueue
        
      4. Extract the attached reproducer
      5. Copy $JBOSS_HOME/bin/client/jboss-client.jar under lib/ directory
      6. Execute mvn initialize to install it in local maven repo
        mvn initialize
        
      7. Execute a producer (or consumer)
        mvn compile exec:java -Dexec.mainClass=com.redhat.jboss.support.example.client.JGroupsDiscoveryProducer  -Djava.net.preferIPv4Stack=true -Djgroups.bind_addr=127.0.0.1 -Djava.util.logging.config.file=custom-logging.properties
        
        mvn compile exec:java -Dexec.mainClass=com.redhat.jboss.support.example.client.JGroupsDiscoveryConsumer  -Djava.net.preferIPv4Stack=true -Djgroups.bind_addr=127.0.0.1 -Djava.util.logging.config.file=custom-logging.properties
        

      Then, you will see NPE repeatedly.

      Show
      Execute add-user.sh to create a JMS user ./bin/add-user.sh -a -u 'test' -p 'test@123' -g 'guest' Start JBoss EAP 7.1.0 with standalone-full-ha.xml Execute jboss-cli to create a JMS Queue jms-queue add --queue-address=testQueue --entries=queue/test,java:jboss/exported/jms/queue/testQueue Extract the attached reproducer Copy $JBOSS_HOME/bin/client/jboss-client.jar under lib/ directory Execute mvn initialize to install it in local maven repo mvn initialize Execute a producer (or consumer) mvn compile exec:java -Dexec.mainClass=com.redhat.jboss.support.example.client.JGroupsDiscoveryProducer -Djava.net.preferIPv4Stack= true -Djgroups.bind_addr=127.0.0.1 -Djava.util.logging.config.file=custom-logging.properties mvn compile exec:java -Dexec.mainClass=com.redhat.jboss.support.example.client.JGroupsDiscoveryConsumer -Djava.net.preferIPv4Stack= true -Djgroups.bind_addr=127.0.0.1 -Djava.util.logging.config.file=custom-logging.properties Then, you will see NPE repeatedly.

    Description

      When a standalone Java client uses Artemis Core API for JGroups Dynamic Discovery, it repeats throwing the following NPE:

      SEVERE [null] JGRP000027: failed passing message up (org.jgroups.protocols.TP$SingleMessageHandler run) 
      java.lang.NullPointerException
      	at java.util.concurrent.LinkedBlockingDeque.offerLast(LinkedBlockingDeque.java:357)
      	at java.util.concurrent.LinkedBlockingDeque.addLast(LinkedBlockingDeque.java:334)
      	at java.util.concurrent.LinkedBlockingDeque.add(LinkedBlockingDeque.java:633)
      	at org.apache.activemq.artemis.api.core.jgroups.JGroupsReceiver.receive(JGroupsReceiver.java:41)
      	at org.apache.activemq.artemis.api.core.jgroups.JChannelWrapper$1.receive(JChannelWrapper.java:69)
      	at org.jgroups.JChannel.invokeCallback(JChannel.java:816)
      	at org.jgroups.JChannel.up(JChannel.java:741)
      	at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1030)
      	at org.jgroups.protocols.FRAG2.up(FRAG2.java:165)
      	at org.jgroups.protocols.FlowControl.up(FlowControl.java:374)
      	at org.jgroups.protocols.FlowControl.up(FlowControl.java:390)
      	at org.jgroups.protocols.pbcast.GMS.up(GMS.java:1037)
      	at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234)
      	at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:442)
      	at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:649)
      	at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:155)
      	at org.jgroups.protocols.FD_ALL.up(FD_ALL.java:200)
      	at org.jgroups.protocols.FD.up(FD.java:260)
      	at org.jgroups.protocols.MERGE3.up(MERGE3.java:292)
      	at org.jgroups.protocols.Discovery.up(Discovery.java:296)
      	at org.jgroups.protocols.TP.passMessageUp(TP.java:1657)
      	at org.jgroups.protocols.TP$SingleMessageHandler.run(TP.java:1872)
      	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)
      

      Also the following IndexOutOfBoundsException sometime occurred. (Not continually but sometime frequently):

      ERROR [org.apache.activemq.artemis.core.client] AMQ214010: Failed to receive datagram (org.apache.activemq.artemis.core.cluster.DiscoveryGroup$DiscoveryRunnable run) 
      java.lang.IndexOutOfBoundsException: readerIndex(8) + length(1040187409) exceeds writerIndex(11): UnpooledHeapByteBuf(ridx: 8, widx: 11, cap: 11/11)
      	at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1396)
      	at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1383)
      	at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:850)
      	at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:858)
      	at io.netty.buffer.WrappedByteBuf.readBytes(WrappedByteBuf.java:649)
      	at org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper.readSimpleStringInternal(ChannelBufferWrapper.java:93)
      	at org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper.readStringInternal(ChannelBufferWrapper.java:114)
      	at org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper.readString(ChannelBufferWrapper.java:99)
      	at org.apache.activemq.artemis.core.cluster.DiscoveryGroup$DiscoveryRunnable.run(DiscoveryGroup.java:274)
      	at java.lang.Thread.run(Thread.java:748)
      

      The standalone Java client calles Artemis Core API to use JGroups Dynamic Discovery like the following. See the attached reproducer for details.

      private static final String channelName = "ee";
      private static final String jgroupsConfigFile = "jgroups-custom-config.xml"; 
      
      String uri = "jgroups://" + channelName + "?file=" + jgroupsConfigFile + "&type=QUEUE_CF";
      ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactory(uri, "...");
      Queue queue = ActiveMQJMSClient.createQueue("testQueue");
      try (JMSContext jmsContext = cf.createContext("test", "test@123")) {
           // sending messages or recieving messages
      }
      

      Attachments

        Issue Links

          Activity

            People

              rhn-support-tmiyargi Teresa Miyar Gil (Inactive)
              rhn-support-mmiura Masafumi Miura
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: