Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D3A7F10E80 for ; Tue, 27 Aug 2013 19:43:56 +0000 (UTC) Received: (qmail 1511 invoked by uid 500); 27 Aug 2013 19:43:56 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 978 invoked by uid 500); 27 Aug 2013 19:43:54 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 638 invoked by uid 99); 27 Aug 2013 19:43:52 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Aug 2013 19:43:52 +0000 Date: Tue, 27 Aug 2013 19:43:52 +0000 (UTC) From: "Timothy Bish (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMQ-4596) AMQP: JMSSecurityExceptions are not propagated back to QPID client on authentication failures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMQ-4596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13751629#comment-13751629 ] Timothy Bish commented on AMQ-4596: ----------------------------------- For me if I add in this code to the onActiveMQCommand's handling of MessageDispatch commands then everything seems to work. {code} if (md.getMessage() != null) { Message message = md.getMessage(); if (!message.getProperties().containsKey("JMS_AMQP_MESSAGE_FORMAT")) { message.setProperty("JMS_AMQP_MESSAGE_FORMAT", 0); } } {code} I couldn't really find anything that informs on the values this property should have but from the code it appears that zero is the not set fall-back so it might be safe enough. > AMQP: JMSSecurityExceptions are not propagated back to QPID client on authentication failures > --------------------------------------------------------------------------------------------- > > Key: AMQ-4596 > URL: https://issues.apache.org/jira/browse/AMQ-4596 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Reporter: Kevin Earls > Fix For: 5.9.0 > > Attachments: AMQ-4596-partial.patch, AMQ-4596.patch > > > I created a broker using a config file that contained: > > > > > > > > With a normal client, the following code will throw a JMSSecurityException on the connection.start(), or connection.createProducer(), or I assume on anything you do with connection. The same is true if I call createConnection with an unknown user, or a known user and invalid password > ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost"); > Connection connection = factory.createConnection(); > connection.start(); > When I use the QPID client though, I don't get the JMSSecurityException. In the logs I can see the exception being thrown by the broker, but it doesn't get propagated back to the client, even if I add an exception listener. The code below will continue along until it hangs on the session.CreateProducer() call. > ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "admin", "password"); > Connection connection = factory.createConnection(); > connection.setExceptionListener(new ExceptionListener() { > @Override > public void onException(JMSException exception) { > exception.printStackTrace(); > } > }); > Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); > QueueImpl queue = new QueueImpl("queue://txqueue"); > MessageProducer p = session.createProducer(queue); > I will attach a unit test that reproduces this. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira