2 Replies Latest reply on May 14, 2014 11:28 AM by joognerbuckie

    Fuse ActiveMQ Config - javax.jms.JMSSecurityException: User name [null] or password is invalid.

    joognerbuckie

      Hey all. I am getting the message javax.jms.JMSSecurityException: User name [null] or password is invalid. when trying to test sending text in Hawtio to a Queue created on the default amq broker in Fuse 6.1. I have uncommented the admin user line in $FUSEHOME/etc/users.properties and restarted the server. I have also gone into the ActiveMQ preferences pane of Hawtio, using the preferences link in the upper right hand corner, and set the username and password there as well with no luck. Still get javax.jms.JMSSecurityException: User name [null] or password is invalid.

       

      I've also put together a small camel route trying to push messages to the queue I created, and pull them back off. Same error message. What's odd is route one can publish to the queue (I see the message in the ActiveMQ section of Hawtio), but I get the invalid user message still, and again, nothing when testing from the admin console. The bean element in my blueprint.xml is as follows:

       

      <bean id="activemq"

            class="org.apache.activemq.camel.component.ActiveMQComponent">

            <property name="brokerURL" value="tcp://localhost:61616"/>

            <property name="userName" value="admin"/>

            <property name="password" value="admin"/>

         </bean>

       

      Any help would be greatly appreciated. I've been scouring the 6.1 documentation, but am not finding any clues as to why this is happening. My current setup is Fuse 6., ActiveMQ 5.6, and OSX 10.8.5. I figure if it's not working from the admin console, it will never work from my camel route code.

       

      Thanks!

      dw

        • 1. Re: Fuse ActiveMQ Config - javax.jms.JMSSecurityException: User name [null] or password is invalid.
          ffang

          Hi,

           

          I did a quick test exactly same as you do, it works for me if I set admin/admin as username/password in Hawtio Activemq preference panel.

           

          Freeman

          • 2. Re: Fuse ActiveMQ Config - javax.jms.JMSSecurityException: User name [null] or password is invalid.
            joognerbuckie

            Hi Freeman. Thanks for your reply. I sincerely appreciate it. Unfortunately, when I set it to admin I still get the same issue. There are a couple of other users I tried creating, but they all have the same problem. Googling showed some similar posts, but nothing with a clear solution that I could see.

             

            Are there any other ActiveMQ security config settings that I may have missed? Spent all day yesterday rummaging through security docs and the various config settings (both in Hawtio and in the config files directly) with no luck.

             

            I am looking at the following documentation for Active MQ to see if there's something I need to add that I'm missing but haven't found the solution yet. https://access.redhat.com/site/documentation/en-US/Red_Hat_JBoss_A-MQ/6.1/html/Security_Guide/files/Auth-CredsForBrokerC…

             

            dw

             

            Update:

            Here are some interesting/suspicious lines in the fuse log, but I'm not sure exactly what they mean to me yet:

             

            10:36:14,398 | INFO  | qtp1367926023-69 | TransportConnector           | 131 - org.apache.activemq.activemq-osgi - 5.9.0.redhat-610379 | Connector vm://amq stopped
            10:36:16,398 | INFO  | ice[amq] Task-26 | TransportConnection          | 131 - org.apache.activemq.activemq-osgi - 5.9.0.redhat-610379 | Stopping vm://amq#4 because Failed with SecurityException: User name [null] or password is invalid.
            10:55:46,558 | INFO  | qtp1367926023-69 | TransportConnector           | 131 - org.apache.activemq.activemq-osgi - 5.9.0.redhat-610379 | Connector vm://amq started
            10:55:46,585 | WARN  | rt: vm://amq#7-1 | TransportConnection          | 131 - org.apache.activemq.activemq-osgi - 5.9.0.redhat-610379 | Failed to add Connection ID:ad40a8f001956f.fullsail.com-54850-1400076736989-9:1

            java.lang.SecurityException: User name [null] or password is invalid.

             

            Why is the connector showing a uri with vm:// in it? Isn't the connection uri supposed to begin with tcp://?

             

             

             

            The stacktrace:

             

            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:1408)

                at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1513)

                at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:327)

                at org.apache.activemq.broker.jmx.DestinationView.sendTextMessage(DestinationView.java:347)

                at org.apache.activemq.broker.jmx.DestinationView.sendTextMessage(DestinationView.java:328)

                at org.apache.activemq.broker.jmx.DestinationView.sendTextMessage(DestinationView.java:323)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:57)

                at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:260)

                at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:94)

                at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:28)

                at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)

                at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)

                at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:264)

                at javax.management.StandardMBean.invoke(StandardMBean.java:391)

                at org.apache.activemq.broker.jmx.AnnotatedMBean.invoke(AnnotatedMBean.java:198)

                at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:835)

                at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:771)

                at org.jolokia.handler.ExecHandler.doHandleRequest(ExecHandler.java:98)

                at org.jolokia.handler.ExecHandler.doHandleRequest(ExecHandler.java:40)

                at org.jolokia.handler.JsonRequestHandler.handleRequest(JsonRequestHandler.java:89)

                at org.jolokia.backend.MBeanServerExecutorLocal.handleRequest(MBeanServerExecutorLocal.java:109)

                at org.jolokia.backend.MBeanServerHandler.dispatchRequest(MBeanServerHandler.java:102)

                at org.jolokia.backend.LocalRequestDispatcher.dispatchRequest(LocalRequestDispatcher.java:98)

                at org.jolokia.backend.BackendManager.callRequestDispatcher(BackendManager.java:409)

                at org.jolokia.backend.BackendManager.handleRequest(BackendManager.java:158)

                at org.jolokia.http.HttpRequestHandler.executeRequest(HttpRequestHandler.java:197)

                at org.jolokia.http.HttpRequestHandler.handlePostRequest(HttpRequestHandler.java:137)

                at org.jolokia.http.AgentServlet$2.handleRequest(AgentServlet.java:399)

                at org.jolokia.http.AgentServlet.handle(AgentServlet.java:287)

                at org.jolokia.http.AgentServlet.doPost(AgentServlet.java:256)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)

                at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)

                at io.hawt.web.AuthenticationFilter$2.run(AuthenticationFilter.java:143)

                at java.security.AccessController.doPrivileged(Native Method)

                at javax.security.auth.Subject.doAs(Subject.java:394)

                at io.hawt.web.AuthenticationFilter.executeAs(AuthenticationFilter.java:140)

                at io.hawt.web.AuthenticationFilter.doFilter(AuthenticationFilter.java:108)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)

                at io.hawt.web.CORSFilter.doFilter(CORSFilter.java:42)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)

                at io.hawt.web.CacheHeadersFilter.doFilter(CacheHeadersFilter.java:37)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)

                at org.ops4j.pax.web.service.internal.WelcomeFilesFilter.doFilter(WelcomeFilesFilter.java:185)

                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)

                at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)

                at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)

                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)

                at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)

                at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)

                at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)

                at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:219)

                at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)

                at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)

                at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)

                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)

                at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:77)

                at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)

                at org.eclipse.jetty.server.Server.handle(Server.java:370)

                at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)

                at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)

                at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)

                at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)

                at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)

                at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)

                at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)

                at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)

                at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)

                at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)

                at java.lang.Thread.run(Thread.java:695)

            Caused by: java.lang.SecurityException: User name [null] or password is invalid.

                at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:80)

                at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:92)

                at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:97)

                at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:764)

                at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139)

                at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:294)

                at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:148)

                at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)

                at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)

                at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:242)

                at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133)

                at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

                ... 1 more

            Caused by: javax.security.auth.login.LoginException: Username can not be null

                at org.apache.karaf.jaas.modules.properties.PropertiesLoginModule.login(PropertiesLoginModule.java:93)

                at org.apache.karaf.jaas.boot.ProxyLoginModule.login(ProxyLoginModule.java:83)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)

                at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)

                at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)

                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:579)

                at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:73)

                ... 14 more