activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qt4x11 <qt4...@gmail.com>
Subject Simple Authentication Plugin - User name or password is invalid
Date Mon, 27 Feb 2012 16:42:45 GMT
I modified our ActiveMQ configuration to use ActiveMQ Simple Authentication
Plugin  and authorization Plugin with a single user and password that has
all rights to the broker

        <plugins>
            <simpleAuthenticationPlugin>
                <users>
                        <authenticationUser
                        username="admin"
                        password="pass"
                        groups="admins,publishers,consumers" />
                </users>
            </simpleAuthenticationPlugin>
         <authorizationPlugin>
              <map>
                  <authorizationMap>
                      <authorizationEntries>
                          <authorizationEntry queue=">" write="producers"
read="consumers" admin="admins" />
                      </authorizationEntries>
                  </authorizationMap>
              </map>
          </authorizationPlugin>

        </plugins>

My java web app was  previously creating an instance of
ActiveMQConnectionFactory by calling createConnection() without any
arguments.

connection = (ActiveMQConnection)connectionFactory.createConnection();


I modified my code to pass the username and password strings defined in my
ActiveMQ Simple Authentication Plugin configuration to the overloaded
version of the createConnection() method

String username = "admin";
String password = "pass";
connection =
(ActiveMQConnection)connectionFactory.createConnection(username, password);

I'm able to compile my code cleanly, but receive 'invalid username or
password' errors when deploying

        09:36:30,821 ERROR [stderr] (MSC service thread 1-16)
javax.jms.JMSException: User name or password is invalid.
        09:36:30,821 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
        09:36:30,822 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1295)
        09:36:30,822 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1392)
        09:36:30,822 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:309)
        09:36:30,823 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.ActiveMQConnection.createQueueSession(ActiveMQConnection.java:1232)
        09:36:30,823 ERROR [stderr] (MSC service thread 1-16) at
com.mycompany.app.anywhere.common.jms.JMSClient.<init>(JMSClient.java:72)
        09:36:30,824 ERROR [stderr] (MSC service thread 1-16) at
com.mycompany.app.anywhere.common.jms.JMSListenerServletTemplate.startJMSConnection(JMSListenerServletTemplate.java:83)
        09:36:30,824 ERROR [stderr] (MSC service thread 1-16) at
com.mycompany.app.anywhere.common.jms.JMSListenerServletTemplate.init(JMSListenerServletTemplate.java:64)
        09:36:30,825 ERROR [stderr] (MSC service thread 1-16) at
com.mycompany.app.anywhere.common.jms.JMSAnywhereServlet.init(JMSAnywhereServlet.java:190)
        09:36:30,825 ERROR [stderr] (MSC service thread 1-16) at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202)
        09:36:30,826 ERROR [stderr] (MSC service thread 1-16) at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102)
        09:36:30,826 ERROR [stderr] (MSC service thread 1-16) at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655)
        09:36:30,826 ERROR [stderr] (MSC service thread 1-16) at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3873)
        09:36:30,827 ERROR [stderr] (MSC service thread 1-16) at
org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)
        09:36:30,827 ERROR [stderr] (MSC service thread 1-16) at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
        09:36:30,828 ERROR [stderr] (MSC service thread 1-16) at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
        09:36:30,828 ERROR [stderr] (MSC service thread 1-16) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        09:36:30,828 ERROR [stderr] (MSC service thread 1-16) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        09:36:30,829 ERROR [stderr] (MSC service thread 1-16) at
java.lang.Thread.run(Thread.java:680)
        09:36:30,830 ERROR [stderr] (MSC service thread 1-16) Caused by:
java.lang.SecurityException: User name or password is invalid.
        09:36:30,830 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.security.SimpleAuthenticationBroker.addConnection(SimpleAuthenticationBroker.java:80)
        09:36:30,830 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:91)
        09:36:30,831 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:692)
        09:36:30,831 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:83)
        09:36:30,832 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:137)
        09:36:30,832 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:306)
        09:36:30,833 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:179)
        09:36:30,833 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69)
        09:36:30,833 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
        09:36:30,834 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:227)
        09:36:30,834 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.transport.TransportLogger.onCommand(TransportLogger.java:114)
        09:36:30,835 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
        09:36:30,835 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:220)
        09:36:30,835 ERROR [stderr] (MSC service thread 1-16) at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)
        09:36:30,836 ERROR [stderr] (MSC service thread 1-16) ... 1 more

This seemed straightforward.  I wonder if there is something wrong with the
way I set up the createConnection() call?  Any advice appreciated.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message