You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Kevin Earls (JIRA)" <ji...@apache.org> on 2013/09/02 10:47:51 UTC

[jira] [Updated] (AMQ-4596) AMQP: JMSSecurityExceptions are not propagated back to QPID client on authentication failures

     [ https://issues.apache.org/jira/browse/AMQ-4596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Earls updated AMQ-4596:
-----------------------------

    Attachment: AMQ-4596_final.patch

Tim, this patch should work correctly.  Please note a couple of things:

1. This includes the code change for AMQ4696, so you should probably apply that first, or ask me for another update.
2. Besides the changes for this bug (which occurs at line 405) there are several other changes for things that were either deprecated in or removed from proton-jms 0.5

                
> 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
>            Assignee: Timothy Bish
>             Fix For: 5.9.0
>
>         Attachments: AMQ-4596_final.patch, AMQ-4596-partial.patch, AMQ-4596.patch, AMQ-4596_updated.patch
>
>
> I created a broker using a config file that contained:
> <simpleAuthenticationPlugin>
>     <users>
>         <authenticationUser username="system" password="systemPassword" groups="users,admins"/>
>        <authenticationUser username="user" password="userPassword" groups="users"/>
>        <authenticationUser username="guest" password="guestPassword" groups="guests"/>
>     </users>
> </simpleAuthenticationPlugin>
> 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