Gordon Sim created QPID-4690:
--------------------------------

             Summary: NPE under the covers when 
ConnectionFactory.createConnection("me", null) is called
                 Key: QPID-4690
                 URL: https://issues.apache.org/jira/browse/QPID-4690
             Project: Qpid
          Issue Type: Bug
          Components: Java Client
    Affects Versions: 0.20
            Reporter: Gordon Sim
            Assignee: Rajith Attapattu
            Priority: Minor


Specifically from line 55 of UsernamePasswordCallbackHandler.java. A null 
password should be treated as no password supplied, and should not result in an 
obscure NPE:

avax.jms.JMSException: Error creating connection: Unable to Connect
        at 
org.apache.qpid.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:159)
        at 
org.apache.qpid.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:134)
        at 
org.fusesource.jmsbenchmark.JMSClientScenario$JMSClient$$anon$1.run(JMSClientScenario.scala:78)
Caused by: org.apache.qpid.AMQConnectionFailureException: Unable to Connect 
[error code 200: reply success]
        at org.apache.qpid.client.AMQConnection.<init>(AMQConnection.java:460)
        at 
org.apache.qpid.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:155)
        ... 2 more
Caused by: org.apache.qpid.AMQException: Cannot connect to broker: null [error 
code 200: reply success]
        at 
org.apache.qpid.client.AMQConnectionDelegate_0_10.makeBrokerConnection(AMQConnectionDelegate_0_10.java:241)
        at 
org.apache.qpid.client.AMQConnection.makeBrokerConnection(AMQConnection.java:604)
        at org.apache.qpid.client.AMQConnection.<init>(AMQConnection.java:383)
        ... 3 more
Caused by: org.apache.qpid.transport.ConnectionException
        at 
org.apache.qpid.transport.ConnectionException.rethrow(ConnectionException.java:67)
        at org.apache.qpid.transport.Connection.connect(Connection.java:267)
        at 
org.apache.qpid.client.AMQConnectionDelegate_0_10.makeBrokerConnection(AMQConnectionDelegate_0_10.java:221)
        ... 5 more
Caused by: org.apache.qpid.transport.ConnectionException
        at org.apache.qpid.transport.Connection.exception(Connection.java:529)
        at 
org.apache.qpid.transport.network.Assembler.exception(Assembler.java:107)
        at 
org.apache.qpid.transport.network.InputHandler.exception(InputHandler.java:199)
        at 
org.apache.qpid.transport.network.io.IoReceiver.run(IoReceiver.java:217)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
        at 
org.apache.qpid.client.security.UsernamePasswordCallbackHandler.handle(UsernamePasswordCallbackHandler.java:55)
        at 
com.sun.security.sasl.ClientFactoryImpl.getUserInfo(ClientFactoryImpl.java:136)
        at 
com.sun.security.sasl.ClientFactoryImpl.createSaslClient(ClientFactoryImpl.java:94)
        at javax.security.sasl.Sasl.createSaslClient(Sasl.java:372)
        at 
org.apache.qpid.client.transport.ClientConnectionDelegate.createSaslClient(ClientConnectionDelegate.java:109)
        at 
org.apache.qpid.transport.ClientDelegate.connectionStart(ClientDelegate.java:92)
        at 
org.apache.qpid.transport.ClientDelegate.connectionStart(ClientDelegate.java:43)
        at 
org.apache.qpid.transport.ConnectionStart.dispatch(ConnectionStart.java:95)
        at 
org.apache.qpid.transport.ConnectionDelegate.control(ConnectionDelegate.java:49)
        at 
org.apache.qpid.transport.ConnectionDelegate.control(ConnectionDelegate.java:40)
        at org.apache.qpid.transport.Method.delegate(Method.java:163)
        at org.apache.qpid.transport.Connection.received(Connection.java:375)
        at org.apache.qpid.transport.Connection.received(Connection.java:62)
        at org.apache.qpid.transport.network.Assembler.emit(Assembler.java:97)
        at 
org.apache.qpid.transport.network.Assembler.assemble(Assembler.java:183)
        at org.apache.qpid.transport.network.Assembler.frame(Assembler.java:131)
        at org.apache.qpid.transport.network.Frame.delegate(Frame.java:128)
        at 
org.apache.qpid.transport.network.Assembler.received(Assembler.java:102)
        at 
org.apache.qpid.transport.network.Assembler.received(Assembler.java:44)
        at 
org.apache.qpid.transport.network.InputHandler.next(InputHandler.java:189)
        at 
org.apache.qpid.transport.network.InputHandler.received(InputHandler.java:105)
        at 
org.apache.qpid.transport.network.InputHandler.received(InputHandler.java:44)
        at 
org.apache.qpid.transport.network.io.IoReceiver.run(IoReceiver.java:161)

--
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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to