Maven running standalone Java client uses Artemis Core API for JGroups Dynamic Discovery throws NullPointerException in JBoss EAP 7
Issue
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
}
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 7
- Maven
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.