Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 667771

Summary: Cannot create a subscription on topic created for another JMS Provider, class of topic provided is: org.apache.qpid.client.AMQAnyDestination
Product: Red Hat Enterprise MRG Reporter: Gordon Sim <gsim>
Component: qpid-javaAssignee: Rajith Attapattu <rattapat+nobody>
Status: CLOSED ERRATA QA Contact: Frantisek Reznicek <freznice>
Severity: high Docs Contact:
Priority: high    
Version: 1.3CC: esammons, freznice
Target Milestone: 2.0   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-23 15:46:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 702247    
Bug Blocks:    
Attachments:
Description Flags
test program none

Description Gordon Sim 2011-01-06 18:19:09 UTC
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:

Comment 1 Gordon Sim 2011-01-06 18:19:47 UTC
Created attachment 472108 [details]
test program

Comment 2 Gordon Sim 2011-01-06 18:22:22 UTC
Workaround is to not use jndi config but to use Session.createTopic() instaed to obtain the Topic destination.

Comment 3 Rajith Attapattu 2011-03-03 04:54:39 UTC
Fixed in upstream at rev 1076516.
http://svn.apache.org/viewvc?rev=1076516&view=rev

Comment 4 Rajith Attapattu 2011-03-15 02:27:27 UTC
The fixes are now included in rpms from version qpid-java-0.9.1080013-2

Comment 5 Rajith Attapattu 2011-03-15 02:27:27 UTC
    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.

Comment 7 Frantisek Reznicek 2011-05-05 06:56:46 UTC
The attached code currently crashes with NPE, see bug 702247 for details. Adding dependency on bug 702247.

Comment 8 Frantisek Reznicek 2011-05-17 08:54:43 UTC
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

Comment 9 errata-xmlrpc 2011-06-23 15:46:45 UTC
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