Bug 695353 - High level API addressing: Java client address parser throws java.lang.ClassCastException on valid address
Summary: High level API addressing: Java client address parser throws java.lang.ClassC...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java
Version: Development
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 2.0
: ---
Assignee: Rajith Attapattu
QA Contact: Frantisek Reznicek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-11 13:23 UTC by Frantisek Reznicek
Modified: 2015-11-16 01:13 UTC (History)
4 users (show)

Fixed In Version: qpid-java-0.10-4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-23 15:49:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


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 Frantisek Reznicek 2011-04-11 13:23:17 UTC
Description of problem:

Current java client code throws java.lang.ClassCastException exception on valid Address:
"ADDR;{create:sender, delete:receiver, node: { type:queue, durable:False }}"

This behavior is seen on RHEL4/5.

Version-Release number of selected component (if applicable):
qpid-java-client-0.10-2.el4.noarch
qpid-java-common-0.10-2.el4.noarch
qpid-java-example-0.10-2.el4.noarch


How reproducible:
100%

Steps to Reproduce:
1. cd /usr/share/doc/qpid-java-0.10/examples
2. ./run_example.sh org.apache.qpid.example.Spout --count 1 "ADDR;{create:sender, delete:receiver, node: { type:queue, durable:False }}"
3. echo $? 

Actual results:
Java JMS client crashes/aborts on valid address.

Expected results:
Java JMS client should not crash/abort on valid address.


Additional info:

[root@mrg-qe-01 examples]# ./run_example.sh org.apache.qpid.example.Spout --count 1 "ADDR;{create:sender, delete:receiver, node: { type:queue, durable:False }}"
{count=1}
log4j:WARN No appenders could be found for logger (org.apache.qpid.client.AMQConnection).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.net.URISyntaxException: Error parsing address: ADDR;{create:sender, delete:receiver, node: { type:queue, durable:False }}
        at org.apache.qpid.client.AMQDestination.<init>(AMQDestination.java:210)
        at org.apache.qpid.client.AMQAnyDestination.<init>(AMQAnyDestination.java:51)
        at org.apache.qpid.example.Spout.<init>(Spout.java:90)
        at org.apache.qpid.example.Spout.main(Spout.java:146)
Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String
        at org.apache.qpid.client.messaging.address.AddressHelper.getDurability(AddressHelper.java:237)
        at org.apache.qpid.client.messaging.address.AddressHelper.fillInCommonNodeArgs(AddressHelper.java:222)
        at org.apache.qpid.client.messaging.address.AddressHelper.createQueueNode(AddressHelper.java:215)
        at org.apache.qpid.client.messaging.address.AddressHelper.getSourceNode(AddressHelper.java:254)
        at org.apache.qpid.client.AMQDestination.getInfoFromAddress(AMQDestination.java:878)
        at org.apache.qpid.client.AMQDestination.<init>(AMQDestination.java:206)
        ... 3 more


or RHEL4:
[root@mrg-qe-03 examples]# ./run_example.sh org.apache.qpid.example.Spout --count 1 "ADDR;{create:sender, delete:receiver, node: { type:queue, durable:False }}"
{count=1}
Apr 11, 2011 9:15:05 AM org.apache.qpid.client.security.DynamicSaslRegistrar registerSaslProviders
INFO: Additional SASL providers successfully registered.
Apr 11, 2011 9:15:05 AM org.apache.qpid.client.AMQConnection <init>
INFO: Connection:amqp://guest:********@test/test?brokerlist='tcp://localhost:5672'
Apr 11, 2011 9:15:05 AM org.apache.qpid.client.protocol.AMQProtocolSession <init>
INFO: Using ProtocolVersion for Session:0-10
Apr 11, 2011 9:15:05 AM org.apache.qpid.client.handler.ClientMethodDispatcherImpl newMethodDispatcher
INFO: New Method Dispatcher:AMQProtocolSession[null]
Apr 11, 2011 9:15:05 AM org.apache.qpid.client.AMQConnection <init>
INFO: Connecting with ProtocolHandler Version:0-10
Apr 11, 2011 9:15:06 AM org.apache.qpid.client.AMQConnection <init>
INFO: Connected with ProtocolHandler Version:0-10
Apr 11, 2011 9:15:06 AM org.apache.qpid.client.AMQSession <init>
INFO: Created session:org.apache.qpid.client.AMQSession_0_10@73d573d5
Exception in thread "main" java.net.URISyntaxException: Error parsing address: ADDR;{create:sender, delete:receiver, node: { type:queue, durable:False }}
        at org.apache.qpid.client.AMQDestination.<init>(AMQDestination.java:210)
        at org.apache.qpid.example.Spout.<init>(Spout.java:90)
        at org.apache.qpid.example.Spout.main(Spout.java:146)
Caused by: java.lang.ClassCastException: java.lang.Boolean incompatible with java.lang.String
        at org.apache.qpid.client.messaging.address.AddressHelper.getDurability(AddressHelper.java:237)
        at org.apache.qpid.client.messaging.address.AddressHelper.fillInCommonNodeArgs(AddressHelper.java:222)
        at org.apache.qpid.client.messaging.address.AddressHelper.createQueueNode(AddressHelper.java:215)
        at org.apache.qpid.client.messaging.address.AddressHelper.getSourceNode(AddressHelper.java:254)
        at org.apache.qpid.client.AMQDestination.getInfoFromAddress(AMQDestination.java:878)
        at org.apache.qpid.client.AMQDestination.<init>(AMQDestination.java:206)
        ... 2 more
[root@mrg-qe-03 examples]# rpm -qa | grep qpid-java
qpid-java-client-0.10-2.el4.noarch
qpid-java-common-0.10-2.el4.noarch
qpid-java-example-0.10-2.el4.noarch
[root@mrg-qe-03 examples]# rpm -qa | grep ^java-1.[56]
java-1.5.0-ibm-1.5.0.12.3-1jpp.1.el4.x86_64
java-1.5.0-ibm-devel-1.5.0.12.3-1jpp.1.el4.x86_64

Comment 1 Rajith Attapattu 2011-04-11 14:29:09 UTC
This was fixed in upstream at rev 1085187 and tracked via QPID-3156
The reason why this wasn't included in the 0.10 release branch was bcos it wasn't a regression nor a serious issue as you can easily workaround this by using "durable:false/true" instead of "durable:False/True".

I have also downgraded the severity and priority to "medium" to reflect the above.

However since a BZ is raised, I will include a fix for this as a patch for the next iteration.

Comment 2 Ted Ross 2011-04-11 17:21:05 UTC
Fixed upstream in commits: 1084462, 1085187

Comment 4 Frantisek Reznicek 2011-05-04 12:50:16 UTC
The issue has been fixed, tested on RHEL 5.6 / 6.1s5 i[36]86 / x86_64 on packages:

python-qpid-0.10-1.el5.noarch
python-qpid-qmf-0.10-6.el5.x86_64
qpid-cpp-client-0.10-4.el5.x86_64
qpid-cpp-client-devel-0.10-4.el5.x86_64
qpid-cpp-client-devel-docs-0.10-4.el5.x86_64
qpid-cpp-client-rdma-0.10-4.el5.x86_64
qpid-cpp-client-ssl-0.10-4.el5.x86_64
qpid-cpp-mrg-debuginfo-0.10-4.el5.x86_64
qpid-cpp-server-0.10-4.el5.x86_64
qpid-cpp-server-cluster-0.10-4.el5.x86_64
qpid-cpp-server-devel-0.10-4.el5.x86_64
qpid-cpp-server-rdma-0.10-4.el5.x86_64
qpid-cpp-server-ssl-0.10-4.el5.x86_64
qpid-cpp-server-store-0.10-4.el5.x86_64
qpid-cpp-server-xml-0.10-4.el5.x86_64
qpid-dotnet-0.4.738274-2.el5.x86_64
qpid-java-client-0.10-4.el5.noarch
qpid-java-common-0.10-4.el5.noarch
qpid-java-example-0.10-4.el5.noarch
qpid-qmf-0.10-6.el5.x86_64
qpid-qmf-debuginfo-0.10-6.el5.x86_64
qpid-qmf-devel-0.10-6.el5.x86_64
qpid-tests-0.10-1.el5.noarch
qpid-tools-0.10-4.el5.noarch
rh-qpid-cpp-tests-0.10-4.el5.x86_64
ruby-qpid-qmf-0.10-6.el5.x86_64
sesame-0.10-1.el5.x86_64
sesame-debuginfo-0.10-1.el5.x86_64

-> VERIFIED

Comment 5 errata-xmlrpc 2011-06-23 15:49:16 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.