[jboss-jira] [JBoss JIRA] (WFLY-9365) Standalone JMS Client repeats throwing NPE when using Artemis Core API for JGroups Dynamic Discovery

Masafumi Miura (JIRA) issues at jboss.org
Wed Sep 20 03:10:00 EDT 2017


     [ https://issues.jboss.org/browse/WFLY-9365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Masafumi Miura updated WFLY-9365:
---------------------------------
    Steps to Reproduce: 
# Execute add-user.sh to create a JMS user
{code}
./bin/add-user.sh -a -u 'test' -p 'test at 123' -g 'guest'
{code}
# Start WildFly 11.0.0.CR1 with standalone-full-ha.xml
# Execute jboss-cli to create a JMS Queue
{code}
jms-queue add --queue-address=testQueue --entries=queue/test,java:jboss/exported/jms/queue/testQueue
{code}
# 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
{code}
mvn initialize
{code}
# Execute a producer (or consumer)
{code}
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
{code}
{code}
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
{code}

Then, you will see NPE repeatedly.

  was:
# Execute add-user.sh to create a JMS user
{code}
./bin/add-user.sh -a -u 'test' -p 'test at 123' -g 'guest'
{code}
# Execute jboss-clie to create a JMS Queue
{code}
jms-queue add --queue-address=testQueue --entries=queue/test,java:jboss/exported/jms/queue/testQueue
{code}
# 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
{code}
mvn initialize
{code}
# Execute a producer (or consumer)
{code}
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
{code}
{code}
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
{code}

Then, you will see NPE repeatedly.



> Standalone JMS Client repeats throwing NPE when using Artemis Core API for JGroups Dynamic Discovery
> ----------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-9365
>                 URL: https://issues.jboss.org/browse/WFLY-9365
>             Project: WildFly
>          Issue Type: Bug
>          Components: JMS
>    Affects Versions: 11.0.0.CR1
>            Reporter: Masafumi Miura
>            Assignee: Jeff Mesnil
>         Attachments: artemis-core-api-client.zip
>
>
> When a standalone Java client uses Artemis Core API for JGroups Dynamic Discovery, it repeats throwing the following NPE:
> {code}
> 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)
> {code}
> Also the following IndexOutOfBoundsException sometime occurred. (Not continually but sometime frequently):
> {code}
> 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)
> {code}
> The standalone Java client calles Artemis Core API to use JGroups Dynamic Discovery like the following. See the attached reproducer for details.
> {code}
> 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 at 123")) {
>      // sending messages or recieving messages
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list