javax.jms.JMSSecurityException: User name [null] or password is invalid.
ericxinzhang opened this issue · 2 comments
ericxinzhang commented
The command line tool looks great! However I'm facing an error, please refer to below for details.
- Platform: Windows 10
- JDK: 1.8.0_172
- Connecting to ActiveMQ server with SSL enabled.
I ran following command but got error as below.
a -b ssl://amq-dev.api.my.com.au:443 -U admin -p adminpass -l
I also modified a.bat
to include the JVM args javax.net.ssl.keyStore
and javax.net.ssl.keyStorePassword
but the issue persists. In fact I don't need to do this because I have added the cert into default JRE lib\security\cacerts file.
javax.jms.JMSSecurityException: User name [null] or password is invalid.
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:52)
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1399)
at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1478)
at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:329)
at co.nordlander.a.A.connect(A.java:383)
at co.nordlander.a.A.run(A.java:185)
at co.nordlander.a.A.main(A.java:156)
Caused by: java.lang.SecurityException: User name [null] or password is invalid.
at org.apache.activemq.security.JaasAuthenticationBroker.authenticate(JaasAuthenticationBroker.java:89)
at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:68)
at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:97)
at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:102)
at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:842)
at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:77)
at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:326)
at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:190)
at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:300)
at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at org.apache.activemq.transport.tcp.SslTransport.doConsume(SslTransport.java:102)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.security.auth.login.FailedLoginException: user name is null
at org.apache.activemq.jaas.PropertiesLoginModule.login(PropertiesLoginModule.java:84)
at sun.reflect.GeneratedMethodAccessor119.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:755)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:195)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:682)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:587)
at org.apache.activemq.security.JaasAuthenticationBroker.authenticate(JaasAuthenticationBroker.java:84)
... 16 more
northlander commented
You need to use uppger case P to supply password. Lower case p is the command to put a message. There are so many options that the alphabet is almost used up for both upper and lower case
ericxinzhang commented
@northlander, sorry, it has been a bad day for me. Somehow I read the uppercase P as lower p. My bad and thanks for your help.