Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 50718976F for ; Mon, 27 Feb 2012 16:58:27 +0000 (UTC) Received: (qmail 37402 invoked by uid 500); 27 Feb 2012 16:58:26 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 37371 invoked by uid 500); 27 Feb 2012 16:58:26 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 37363 invoked by uid 99); 27 Feb 2012 16:58:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Feb 2012 16:58:26 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of qt4x11@gmail.com designates 209.85.210.43 as permitted sender) Received: from [209.85.210.43] (HELO mail-pz0-f43.google.com) (209.85.210.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Feb 2012 16:58:18 +0000 Received: by damc16 with SMTP id c16so1911352dam.2 for ; Mon, 27 Feb 2012 08:57:58 -0800 (PST) Received-SPF: pass (google.com: domain of qt4x11@gmail.com designates 10.68.194.8 as permitted sender) client-ip=10.68.194.8; Authentication-Results: mr.google.com; spf=pass (google.com: domain of qt4x11@gmail.com designates 10.68.194.8 as permitted sender) smtp.mail=qt4x11@gmail.com; dkim=pass header.i=qt4x11@gmail.com Received: from mr.google.com ([10.68.194.8]) by 10.68.194.8 with SMTP id hs8mr42529940pbc.113.1330361878558 (num_hops = 1); Mon, 27 Feb 2012 08:57:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Acx45fVFkQr3RJYU+z1gpXUNRSD6an4C2yIJRkPKREs=; b=sb4lZLZGlqjFi8Kq1AQwOO9lU2tAnOdonHlmw1DBG5K7ivxocmPn6ARdg1xvkyv4Gs YlhKALAV9A7/HogimdOq4oIgSiYp4/fDeEzpOj/L43ndcqzZl5lsplNRW5VgEoc/Ys11 QutZ9uWCCj8pGNCLdll2vuuIH4r5xZamtP150= MIME-Version: 1.0 Received: by 10.68.194.8 with SMTP id hs8mr36076804pbc.113.1330361878354; Mon, 27 Feb 2012 08:57:58 -0800 (PST) Received: by 10.142.238.4 with HTTP; Mon, 27 Feb 2012 08:57:58 -0800 (PST) In-Reply-To: References: Date: Mon, 27 Feb 2012 10:57:58 -0600 Message-ID: Subject: Re: Simple Authentication Plugin - User name or password is invalid From: qt4x11 To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=047d7b15aeb32e9a3304b9f50331 --047d7b15aeb32e9a3304b9f50331 Content-Type: text/plain; charset=ISO-8859-1 I actually copied the wrong log snippet- the errors we're actually seeing in the log are 'user is not authorized to create topic' errors 10:51:03,831 ERROR [stderr] (MSC service thread 1-11) javax.jms.JMSException: User admin is not authorized to create: topic://ActiveMQ.Advisory.Connection 10:51:03,832 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49) 10:51:03,832 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1295) 10:51:03,833 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1392) 10:51:03,834 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:309) 10:51:03,834 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.ActiveMQConnection.createQueueSession(ActiveMQConnection.java:1232) 10:51:03,835 ERROR [stderr] (MSC service thread 1-11) at com.company.app.anywhere.common.jms.JMSClient.(JMSClient.java:74) 10:51:03,836 ERROR [stderr] (MSC service thread 1-11) at com.company.app.anywhere.common.jms.JMSListenerServletTemplate.startJMSConnection(JMSListenerServletTemplate.java:83) 10:51:03,836 ERROR [stderr] (MSC service thread 1-11) at com.company.app.anywhere.common.jms.JMSListenerServletTemplate.init(JMSListenerServletTemplate.java:64) 10:51:03,837 ERROR [stderr] (MSC service thread 1-11) at com.company.app.anywhere.common.jms.JMSAnywhereServlet.init(JMSAnywhereServlet.java:190) 10:51:03,837 ERROR [stderr] (MSC service thread 1-11) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) 10:51:03,838 ERROR [stderr] (MSC service thread 1-11) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) 10:51:03,838 ERROR [stderr] (MSC service thread 1-11) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) 10:51:03,838 ERROR [stderr] (MSC service thread 1-11) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) 10:51:03,839 ERROR [stderr] (MSC service thread 1-11) at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) 10:51:03,839 ERROR [stderr] (MSC service thread 1-11) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) 10:51:03,840 ERROR [stderr] (MSC service thread 1-11) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) 10:51:03,840 ERROR [stderr] (MSC service thread 1-11) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 10:51:03,841 ERROR [stderr] (MSC service thread 1-11) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 10:51:03,841 ERROR [stderr] (MSC service thread 1-11) at java.lang.Thread.run(Thread.java:680) 10:51:03,842 ERROR [stderr] (MSC service thread 1-11) Caused by: java.lang.SecurityException: User admin is not authorized to create: topic://ActiveMQ.Advisory.Connection 10:51:03,842 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.security.AuthorizationBroker.addDestination(AuthorizationBroker.java:76) 10:51:03,843 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.broker.MutableBrokerFilter.addDestination(MutableBrokerFilter.java:151) 10:51:03,843 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:502) 10:51:03,844 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.advisory.AdvisoryBroker.fireAdvisory(AdvisoryBroker.java:515) 10:51:03,844 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.advisory.AdvisoryBroker.fireAdvisory(AdvisoryBroker.java:446) 10:51:03,844 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.advisory.AdvisoryBroker.fireAdvisory(AdvisoryBroker.java:441) 10:51:03,845 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:73) 10:51:03,846 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85) 10:51:03,846 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85) 10:51:03,847 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85) 10:51:03,848 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.security.SimpleAuthenticationBroker.addConnection(SimpleAuthenticationBroker.java:96) 10:51:03,848 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85) 10:51:03,849 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:91) 10:51:03,850 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:692) 10:51:03,851 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:83) 10:51:03,851 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:137) 10:51:03,852 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:306) 10:51:03,853 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:179) 10:51:03,854 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69) 10:51:03,854 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113) 10:51:03,858 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:227) 10:51:03,859 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.transport.TransportLogger.onCommand(TransportLogger.java:114) 10:51:03,860 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83) 10:51:03,860 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:220) 10:51:03,861 ERROR [stderr] (MSC service thread 1-11) at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202) 10:51:03,861 ERROR [stderr] (MSC service thread 1-11) ... 1 more Thank you for any advice. On Mon, Feb 27, 2012 at 10:42 AM, qt4x11 wrote: > 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 > > > > > username="admin" > password="pass" > groups="admins,publishers,consumers" /> > > > > > > > read="consumers" admin="admins" /> > > > > > > > > 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.(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. > > > > > --047d7b15aeb32e9a3304b9f50331--