Description of problem: Running simple attached reproducer in maven, NPE is raised. Version-Release number of selected component (if applicable): 0.18-2 How reproducible: 100% Steps to Reproduce: 1. Install junit, spring-framework and maven 2. unzip attachment, optionally modify brokerlist in MrgmNpeTest-context.xml to whatever else than default "localhost" 3. mvn test 4. If repeating the test, ensure that maven repository contains proper jar files!!! It automatically tries to _download_ files from qpid.apache.org, ignoring whatever is installed. To replace maven repository, do: cp -f /usr/share/java/qpid-common-0.18.jar /root/.m2/repository/org/apache/qpid/qpid-common/0.18/qpid-common-0.18.jar cp -f /usr/share/java/qpid-client-0.18.jar /root/.m2/repository/org/apache/qpid/qpid-client/0.18/qpid-client-0.18.jar (and re-run the test with -o option to make maven offline) Actual results: ------------------------------------------------------------------------------- Test set: com.redhat.mrgm.npe.MrgmNpeTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.012 sec <<< FAILURE! testNpe(com.redhat.mrgm.npe.MrgmNpeTest) Time elapsed: 0.879 sec <<< ERROR! java.lang.NullPointerException at org.apache.qpid.client.AMQDestination.equals(AMQDestination.java:603) at org.springframework.jms.connection.CachingConnectionFactory$DestinationCacheKey.destinationEquals(CachingConnectionFactory.java:467) at org.springframework.jms.connection.CachingConnectionFactory$DestinationCacheKey.equals(CachingConnectionFactory.java:474) at java.util.HashMap.get(HashMap.java:305) at org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.getCachedProducer(CachingConnectionFactory.java:353) at org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.invoke(CachingConnectionFactory.java:320) at $Proxy9.createProducer(Unknown Source) at org.springframework.jms.core.JmsTemplate.doCreateProducer(JmsTemplate.java:971) at org.springframework.jms.core.JmsTemplate.createProducer(JmsTemplate.java:952) at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:563) at org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:546) at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:466) at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:543) at com.redhat.mrgm.npe.MrgmNpeTest.testNpe(MrgmNpeTest.java:34) .. Expected results: Test passes. Additional info: Simple patch proposed.
Created attachment 669620 [details] reproducer
Created attachment 669622 [details] Proposed patch Proposed patch.
*** Bug 853197 has been marked as a duplicate of this bug. ***
Switching assignment as BZ-784270 appears to be a duplicate, or at the very least close to the same issue. As Rajith is looking at this makes sense for him to kill two birds with one stone...so to speak.
Fixed in upstream (QPID-3769) http://svn.apache.org/r1456007 http://svn.apache.org/r1456008 Committed a slightly modified version of Siddesh's patch. Added a fix to hashcode as well and added a test case.
tested on packages: qpid-java-common-0.22-2.el5 qpid-java-client-0.22-2.el5 & qpid-java-common-0.22-3.el6.noarch qpid-java-client-0.22-3.el6.noarch
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHEA-2014-1296.html