You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/05/03 11:57:00 UTC
[jira] [Commented] (QPID-7898) [Java 0-8...0-9-1 Client] Calling
getJMSReplyTo on a received message can lead to NullPointerException
[ https://issues.apache.org/jira/browse/QPID-7898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16462328#comment-16462328 ]
ASF subversion and git services commented on QPID-7898:
-------------------------------------------------------
Commit 78f5671f2b87a11404d0d8d8521dd6c2b02da3ff in qpid-broker-j's branch refs/heads/master from [~k-wall]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-broker-j.git;h=78f5671 ]
NO-JIRA: Remove test exclusion related to QPID-7898
> [Java 0-8...0-9-1 Client] Calling getJMSReplyTo on a received message can lead to NullPointerException
> ------------------------------------------------------------------------------------------------------
>
> Key: QPID-7898
> URL: https://issues.apache.org/jira/browse/QPID-7898
> Project: Qpid
> Issue Type: Bug
> Components: JMS AMQP 0-x
> Reporter: Lorenz Quack
> Assignee: Keith Wall
> Priority: Major
> Fix For: qpid-java-client-0-x-6.3.0
>
>
> A call to {{Message#getJMSReplyTo()}} can lead to a {{NullPointerException}}.
> {noformat}java.lang.NullPointerException
> at org.apache.qpid.client.message.AMQMessageDelegate_0_8.getJMSReplyTo(AMQMessageDelegate_0_8.java:301)
> at org.apache.qpid.client.message.AbstractJMSMessage.getJMSReplyTo(AbstractJMSMessage.java:104){noformat}
> The circumstances are
> * a Message received over AMQP 0-8...0-9-1
> * the replyTo set to a non-BURL address not containing a slash ("/")
> * the address must not exist in the org.apache.qpid.client.message.AMQMessageDelegate_0_8#_destinationCache
> The code throwing the NPE:
> {code:title=AMQMessageDelegate_0_8#getJMSReplyTo (slightly edited for clarity)}public Destination getJMSReplyTo() throws JMSException
> {
> String replyToEncoding = getContentHeaderProperties().getReplyToAsString();
> Destination dest;
> try {
> BindingURL binding = new AMQBindingURL(replyToEncoding);
> // something else
> } catch (URISyntaxException e) {
> if (replyToEncoding.startsWith("/")) {
> // something
> } else if (replyToEncoding.contains("/")) {
> // something
> } else if (getAMQSession().isQueueBound(replyToEncoding, null, null)) {
> // THE ABOVE CALL TO getAMQSession THROWS A NPE!!!
> } else {
> // something
> }
> }
> return dest;
> }{code}
> The root cause seems to be that we are relying on the Message having knowledge of the session but we aren't setting the Session on the Message on all code paths.
> I encountered this testing message conversion.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org