-
Bug
-
Resolution: Done
-
Major
-
7.1.6.GA, 7.3.2.GA
When calling a createSession on connection a java.lang.NullPointerException is thrown
java.lang.NullPointerException at org.apache.activemq.artemis.jms.client.ActiveMQConnection.createSessionInternal(ActiveMQConnection.java:619) at org.apache.activemq.artemis.jms.client.ActiveMQConnection.createQueueSession(ActiveMQConnection.java:435)
Looking at the code the same issue exist in EAP 7.3.0.GA with later version or Artemis. The NPE is caused by ClientSessionFactory.Impl.createSessionInternal() method returning null if a connection is already closed. This condition may be triggered if multiple threads are trying to use a connection. If one thread closes a connection while another is trying to create a session the NPE may be triggered.
I think it would be wise to check for null in
ActiveMQConnection.createSessionInternal()
before calling
session.addFailureListener(listener);
and throw an exception if it is.
- incorporates
-
ENTMQBR-3817 [LTS] The createSession() method throws java.lang.NullPointerException
- Closed
- is caused by
-
ENTMQBR-3490 The createSession() method throws java.lang.NullPointerException
- Closed
- is incorporated by
-
JBEAP-19272 [GSS](7.1.z) The createSession() method throws java.lang.NullPointerException
- Closed
-
JBEAP-20029 [GSS](7.3.z) Upgrade Artemis from 2.9.0.redhat-00011 to 2.9.0.redhat-00016
- Closed