Description of problem: When trying to create a durable subscriber for a Topic obtained via org.apache.qpid.jndi.PropertiesFileInitialContextFactory using new address format, the following exception is thrown: Exception occurred: javax.jms.InvalidDestinationException: Cannot create a subscription on topic created for another JMS Provider, class of topic provided is: org.apache.qpid.client.AMQAnyDestination javax.jms.InvalidDestinationException: Cannot create a subscription on topic created for another JMS Provider, class of topic provided is: org.apache.qpid.client.AMQAnyDestination at org.apache.qpid.client.AMQSession.checkValidTopic(AMQSession.java:2251) at org.apache.qpid.client.AMQSession_0_10.createDurableSubscriber(AMQSession_0_10.java:937) at DurableReceiver.main(DurableReceiver.java:24) Version-Release number of selected component (if applicable): qpid-java-client-0.7.946106-12.el5 qpid-java-common-0.7.946106-12.el5 How reproducible: 100% Steps to Reproduce: 1. run attached test program Actual results: Error as above Expected results: No error; successful subscription to amq.topic. Additional info:
Created attachment 472108 [details] test program
Workaround is to not use jndi config but to use Session.createTopic() instaed to obtain the Topic destination.
Fixed in upstream at rev 1076516. http://svn.apache.org/viewvc?rev=1076516&view=rev
The fixes are now included in rpms from version qpid-java-0.9.1080013-2
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: When creating a durable subscriber with a destination created using an addressing string a javax.jms.InvalidDestinationException is thrown. Consequence: The application is unable to create durable subscriptions from destinations created using an addressing string. The workaround was to create a Topic using session.createTopic method passing an address string. Fix: The createDurableSubscription method modified it's destination validation to check if the destination passed in is an instance of javax.jms.Topic and org.apache.qpid.client.AMQDestination instead of just checking if the destination is an instance of org.apache.qpid.client.AMQTopic Result: The createDurableSubscription method is now able to create a durable subscriber from a destination created using an address string.
The attached code currently crashes with NPE, see bug 702247 for details. Adding dependency on bug 702247.
The issue has been corrected on qpid-java-0.10-6, tested on RHEL 5.6/6.1 i[36]86 / x86_64, no more above NPE/exception seen, messages received ok. -> VERIFIED
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2011-0890.html