[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=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-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[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=16253489#comment-16253489 ] ASF subversion and git services commented on QPID-7898: --- Commit 9aea5431ebad90e2f64710ba704d721ca8a0a48e in qpid-jms-amqp-0-x's branch refs/heads/master from [~k-wall] [ https://git-wip-us.apache.org/repos/asf?p=qpid-jms-amqp-0-x.git;h=9aea543 ] QPID-7898: Address review feedback from Alex Rudyy> [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 > 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 (v6.4.14#64029) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[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=16253341#comment-16253341 ] Alex Rudyy commented on QPID-7898: -- The implemented changes in {{AMQMessageDelegate_0_8#getJMSReplyTo}} make assumption that for non-BURL destination the exchange type is {{direct}}. That could lead to connection close when the real exchange type is not {{direct}} and on sending a reply into the destination the client would attempt to re-declare the exchange (which is a default behavior). The broker side validation of exchange type will close the connection with error "not-allowed". I am wondering whether we can mark {{NonBURLReplyToDestination}} as not requiring exchange/queue re-declaration {{neverDeclare}} in order to avoid running into connection close due to exchange type mismatch. We need to add a check for {{neverDeclare}} into {{BasicMessageProducer#validateDestination}}. Though, it might lead to reply message loss if destination does not exist. Potentially, {{BasicMessageProducer#validateDestination}} can check for existence for destinations with {{neverDeclare}}={{true}}. > [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 > 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 (v6.4.14#64029) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[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=16251757#comment-16251757 ] ASF subversion and git services commented on QPID-7898: --- Commit ae6d79d38334127039e2d62826d9c441f60f1659 in qpid-jms-amqp-0-x's branch refs/heads/master from [~k-wall] [ https://git-wip-us.apache.org/repos/asf?p=qpid-jms-amqp-0-x.git;h=ae6d79d ] QPID-7898: [Qpid JMS AMQP 0-x] Prevent possibilities of NPEs when 0-8 path parses a reply-to address that is not BURL formatted > [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: Java Client >Reporter: Lorenz Quack > 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 (v6.4.14#64029) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[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=16244276#comment-16244276 ] Lorenz Quack commented on QPID-7898: Fun fact: if this problem is solved the next one pops right out: All calls to the {{NonBURLReplyToDestination}} constructor fail in {{AMQDestination:381}} because we pass in {{null}} as the {{exchangeClass}} in {{AMQMessageDelegate_0_8.NonBURLReplyToDestination#NonBURLReplyToDestination}}. > [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: Java Client >Reporter: Lorenz Quack > 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 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 (v6.4.14#64029) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org