Bug 667771 - Cannot create a subscription on topic created for another JMS Provider, class of topic provided is: org.apache.qpid.client.AMQAnyDestination
Summary: Cannot create a subscription on topic created for another JMS Provider, class...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java
Version: 1.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 2.0
: ---
Assignee: Rajith Attapattu
QA Contact: Frantisek Reznicek
URL:
Whiteboard:
Depends On: 702247
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-06 18:19 UTC by Gordon Sim
Modified: 2015-11-16 01:13 UTC (History)
2 users (show)

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.
Clone Of:
Environment:
Last Closed: 2011-06-23 15:46:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
test program (1.96 KB, text/x-java)
2011-01-06 18:19 UTC, Gordon Sim
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2011:0890 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 2.0 Release 2011-06-23 15:42:41 UTC

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


Note You need to log in before you can comment on or make changes to this bug.