| Summary: | Qpid java client NullPointer Exception in BasicMessageProducer_0_10 when specified address does not exist | ||
|---|---|---|---|
| Product: | Red Hat Enterprise MRG | Reporter: | Frantisek Reznicek <freznice> |
| Component: | qpid-java | Assignee: | Rajith Attapattu <rattapat+nobody> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Frantisek Reznicek <freznice> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 1.3 | CC: | esammons, gsim, iboverma |
| Target Milestone: | 1.3.2-RC2 | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | qpid-java-0.7.946106-15 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Frantisek Reznicek
2011-01-24 12:29:24 UTC
The transactional client is not the key as I can see similar the behavior with org.apache.qpid.example.Spout example: [root@dhcp-26-233 bz667428]# cd /usr/share/doc/qpid-java-0.7.946106/examples [root@dhcp-26-233 examples]# ./run_example.sh org.apache.qpid.example.Spout "ADDRq" {} main 2011-01-24 13:27:45,611 WARN [apache.qpid.client.BasicMessageProducer_0_10] Exception occured while verifying destination org.apache.qpid.AMQException: The name 'ADDRq' supplied in the address doesn't resolve to an exchange or a queue at org.apache.qpid.client.AMQSession_0_10.handleAddressBasedDestination(AMQSession_0_10.java:1232) at org.apache.qpid.client.BasicMessageProducer_0_10.declareDestination(BasicMessageProducer_0_10.java:81) at org.apache.qpid.client.BasicMessageProducer.<init>(BasicMessageProducer.java:141) at org.apache.qpid.client.BasicMessageProducer_0_10.<init>(BasicMessageProducer_0_10.java:60) at org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:663) at org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:82) at org.apache.qpid.client.AMQSession$6.execute(AMQSession.java:2404) at org.apache.qpid.client.AMQSession$6.execute(AMQSession.java:2399) at org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:278) at org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:765) at org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102) at org.apache.qpid.client.AMQSession.createProducerImpl(AMQSession.java:2397) at org.apache.qpid.client.AMQSession.createProducerImpl(AMQSession.java:2391) at org.apache.qpid.client.AMQSession.createProducer(AMQSession.java:1054) at org.apache.qpid.client.AMQSession.createProducer(AMQSession.java:95) at org.apache.qpid.example.Spout.<init>(Spout.java:91) at org.apache.qpid.example.Spout.main(Spout.java:146) Exception in thread "main" java.lang.NullPointerException at org.apache.qpid.client.BasicMessageProducer_0_10.sendMessage(BasicMessageProducer_0_10.java:165) at org.apache.qpid.client.BasicMessageProducer.sendImpl(BasicMessageProducer.java:490) at org.apache.qpid.client.BasicMessageProducer.sendImpl(BasicMessageProducer.java:445) at org.apache.qpid.client.BasicMessageProducer.send(BasicMessageProducer.java:283) at org.apache.qpid.example.Spout.<init>(Spout.java:98) at org.apache.qpid.example.Spout.main(Spout.java:146) Bug Analysis ------------- The real underlying issue here is that an exception is not thrown when constructing the MessageProducer with an invalid destination. The address validation code does throw an exception, but it's merely logged and not propagated up the stack. Proposed Solution ----------------- This issue is tracked in upstream via QPID-3019 and is fixed in rev 1063123 in Qpid trunk. The commit contains the following, 1. Modified the createMessageProducer methods (in AMQSession/AMQSession_0 _10/AMQSession_0_8) to throw JMSException 2. Modified the constructors in BasicMessageProducer (0-10 & 0-8 classes) to throw AMQException 3. Added error handling code in BasicMessageProducer_0_10.java constructor to catch and report exceptions from the address validation code. Impact From Proposed Solution ------------------------------ * All changes are minor additions to improve error handling. It involves throwing exceptions up the stack and/or catching an exception and rethrowing after encapsulating in a JMS Exception. * The changes only affect the creation of a producer and has no bearing on any other functionality. This issue is tracked in upstream via QPID-3019 A fix was committed at rev 1063123 in Qpid trunk. Ported to the internal git repo at http://mrg1.lab.bos.redhat.com/cgit/qpid.git/commit/?h=mrg_1.3.0.x&id=a5e93fc5c2d446692d44710d3fdf217608846c35 http://mrg1.lab.bos.redhat.com/cgit/qpid.git/commit/?h=mrg_1.3.0.x&id=0dd5ab7c41358dd45d59332273353399311677b2 The fixes have been incorporated into qpid-java-0.7.946106-15 The issue has been fixed, tested on RHEL 4.9beta, RHEL 5.6 on packages:
python-qpid-0.7.946106-15.el5
qpid-cpp-client-0.7.946106-27.el5
qpid-cpp-client-devel-0.7.946106-27.el5
qpid-cpp-client-devel-docs-0.7.946106-27.el5
qpid-cpp-client-ssl-0.7.946106-27.el5
qpid-cpp-mrg-debuginfo-0.7.946106-27.el5
qpid-cpp-server-0.7.946106-27.el5
qpid-cpp-server-cluster-0.7.946106-27.el5
qpid-cpp-server-devel-0.7.946106-27.el5
qpid-cpp-server-ssl-0.7.946106-27.el5
qpid-cpp-server-store-0.7.946106-27.el5
qpid-cpp-server-xml-0.7.946106-27.el5
qpid-java-client-0.7.946106-15.el5
qpid-java-common-0.7.946106-15.el5
qpid-java-example-0.7.946106-15.el5
qpid-tools-0.7.946106-12.el5
The current package set ends in above described case with reasonable exception:
Exception in thread "main" javax.jms.JMSException: Error creating producer
at org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:670)
at org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:82)
at org.apache.qpid.client.AMQSession$6.execute(AMQSession.java:2404)
at org.apache.qpid.client.AMQSession$6.execute(AMQSession.java:2399)
at org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:278)
at org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:765)
at org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
at org.apache.qpid.client.AMQSession.createProducerImpl(AMQSession.java:2397)
at org.apache.qpid.client.AMQSession.createProducerImpl(AMQSession.java:2391)
at org.apache.qpid.client.AMQSession.createProducer(AMQSession.java:1054)
at org.apache.qpid.client.AMQSession.createProducer(AMQSession.java:95)
at org.apache.qpid.example.Spout.<init>(Spout.java:91)
at org.apache.qpid.example.Spout.main(Spout.java:146)
Caused by: org.apache.qpid.AMQException: Exception occured while verifying destination
at org.apache.qpid.client.BasicMessageProducer_0_10.declareDestination(BasicMessageProducer_0_10.java:86)
at org.apache.qpid.client.BasicMessageProducer.<init>(BasicMessageProducer.java:141)
at org.apache.qpid.client.BasicMessageProducer_0_10.<init>(BasicMessageProducer_0_10.java:61)
at org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:665)
... 12 more
Caused by: org.apache.qpid.AMQException: The name 'XXXHhjhjhjhd' supplied in the address doesn't resolve to an exchange or a queue
at org.apache.qpid.client.AMQSession_0_10.handleAddressBasedDestination(AMQSession_0_10.java:1243)
at org.apache.qpid.client.BasicMessageProducer_0_10.declareDestination(BasicMessageProducer_0_10.java:82)
... 15 more
-> VERIFIED
|