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 70B6B4670 for ; Wed, 25 May 2011 08:03:23 +0000 (UTC) Received: (qmail 63017 invoked by uid 500); 25 May 2011 08:03:23 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 62955 invoked by uid 500); 25 May 2011 08:03:23 -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 62946 invoked by uid 99); 25 May 2011 08:03:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 May 2011 08:03:22 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chubrilo@gmail.com designates 209.85.161.43 as permitted sender) Received: from [209.85.161.43] (HELO mail-fx0-f43.google.com) (209.85.161.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 May 2011 08:03:18 +0000 Received: by fxm3 with SMTP id 3so7042546fxm.2 for ; Wed, 25 May 2011 01:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=HdTiKLNVjhssV7M/Fsxbd1qrKi8wmRPypuD4lJeJHNg=; b=AGGSMo4L3Q7gxw74D8ChPZKfq/PjOc0Wat+n6GB43hJcdJi8vdwX2oCurd+S8MwWwa Mg7dSlz3srL5WR6+VP58lsQH7jXipGubEaW3YJ5wS+6lh1QYGa7//OdrKeo7YZ9yQPqL PocXZtS/hIunVyk7+PAQOzLPqU8beDajL+ZCI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=PrN5Z8KjwERBtGmJnqsRv+MrPVFy3QAscU9gr9teVL7bQMrun8Kvmj+6J9xSG1E+mX 7vNZlm9/5DYzN8YcrAd5/jdXiFEiydNWZ+c4of5o6wv8Bcf3lN5MMtWvLAbdFFJoF96q ISMAdxeyIfiB1/QlGUvnnT2hiE5bSIq9iIgpU= MIME-Version: 1.0 Received: by 10.223.98.82 with SMTP id p18mr136301fan.64.1306310577512; Wed, 25 May 2011 01:02:57 -0700 (PDT) Sender: chubrilo@gmail.com Received: by 10.223.83.144 with HTTP; Wed, 25 May 2011 01:02:57 -0700 (PDT) In-Reply-To: <1306296608889-3548843.post@n4.nabble.com> References: <1306296608889-3548843.post@n4.nabble.com> Date: Wed, 25 May 2011 10:02:57 +0200 X-Google-Sender-Auth: PJ8NkMasbsw3NAgPkOjRltducAA Message-ID: Subject: Re: Starting WebConsole .war in embedded Jetty and vm:// broker.. JNDI config? From: Dejan Bosanac To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=0015174c4496f0608304a4152163 --0015174c4496f0608304a4152163 Content-Type: text/plain; charset=ISO-8859-1 Hi, if you're using jndi, you need to se connection factory and other params using jndi (see http://activemq.apache.org/web-console.html#WebConsole-ConfigureusingJNDI) -Dwebconsole.jms.url=vm://myapp -Dwebconsole.type=properties will work if you're using system properties to set your web console ( http://activemq.apache.org/web-console.html#WebConsole-ConfigureusingSystemProperties ) Regards -- Dejan Bosanac - http://twitter.com/dejanb ----------------- The experts in open source integration and messaging - http://fusesource.com ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net Connect at CamelOne May 24-26 The Open Source Integration Conference On Wed, May 25, 2011 at 6:10 AM, neek wrote: > Starting WebConsole .war in embedded Jetty.. JNDI config? > > Hi there, > > I'm getting started using ActiveMQ, have searched this list and googled but > I'm going in circles. My environment is a Jetty embedded server, running > my > main web app which starts ActiveMQ via jndi.properties. Now I am trying to > run the web console, which I'm doing by including the > activemq-web-console-5.5.0.war as a WebAppContext. So, I have a single VM > running Jetty and the two web apps, mine and the webconsole war. > > Java VM -> Jetty embedded > -> WebAppContext (myapp.war) > -> WebAppContext (activemq-web-console-5.5.0.war) > > The main web app, with the embedded ActiveMQ, works fine. I have followed > http://activemq.apache.org/jndi-support.html which went smoothly, the jndi > file says: > > =============== > java.naming.factory.initial = > org.apache.activemq.jndi.ActiveMQInitialContextFactory > > java.naming.provider.url = vm://myapp > > connectionFactoryNames = connectionFactory > > queue.testqueue = myapp.testqueue > ================= > > This jndi.properties is in the root of my main app .war, so it's not > visible > to the webconsole.war webapp. > > So all my Java code is pure JMS with no ActiveMQ specifics. Nice. The > main > web app can start the queue, publish messages and consumers consume them. > > Now, adding the webconsole.war to Jetty, I am having trouble because I'm a > JNDI newbie. I have read http://activemq.apache.org/web-console.html but > am > not sure which bits of instructions to follow. The "Starting the Web > Console in a seperate VM/in a Web-Container" seems good, except it's not in > a separate VM, it's in the same VM. > > I've tried setting the following VM arguments: > -Dwebconsole.type=jndi > -Dwebconsole.jms.url=vm://myapp > > However the webconsole war fails init: > > [java] WARNING: Failed startup of context > > o.e.j.w.WebAppContext{/webconsole,file:/tmp/jetty-0.0.0.0-8080-activemq-web-console-5.5.0.war-_webconsole-any-/webapp/},/downloads/activemq-web-console-5.5.0.war > [java] org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'sessionPool' defined in ServletContext resource > [/WEB-INF/webconsole-jndi.xml]: Cannot resolve reference to bean > 'connectionFactory' while setting bean property 'connectionFactory'; nested > exception is org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'connectionFactory' defined in ServletContext > resource [/WEB-INF/webconsole-jndi.xml]: Instantiation of bean failed; > nested exception is > org.springframework.beans.factory.BeanDefinitionStoreException: Factory > method [public javax.jms.ConnectionFactory > org.apache.activemq.web.config.JNDIConfiguration.getConnectionFactory()] > threw exception; nested exception is java.lang.IllegalArgumentException: > Neither a ConnectionFactory nor a JMS-url were specified > [java] at > > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) > > That exception, "IllegalArgumentException: Neither a ConnectionFactory nor > a > JMS-url were specified", is confusing, because I'm expecting the > webconsole.type=jndi to cause it to look everything up via JNDI. I've a > feeling the exception message is misleading. I found a reference to the > exception in source code: > > > http://activemq.2283324.n4.nabble.com/svn-commit-r751656-in-activemq-trunk-activemq-web-console-src-main-resources-activemq-web-console-sr-td2395670.html > > It seems to be thrown inside makeConnectionFactory(jmsUrl, jmsUser, > jmsPassword) but I've a strong feeling I've simply mis-configured the > system > properties that webconsole uses. > > I would guess that trying to use a tcp:// url instead of vm:// would not > help, as the exception says a required configuration property is missing, > not that a connection couldn't be made. > > Just running the webconsole.war in the same Jetty setup, with no -D system > properties set, starts fine, and I can view the web gui and see no queues > naturally because it's running its own broker. I'm stuck with connecting > it > to the vm:// broker running in my main app via the correct system > properties. > > Any clues? :) > Nick > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Starting-WebConsole-war-in-embedded-Jetty-and-vm-broker-JNDI-config-tp3548843p3548843.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > --0015174c4496f0608304a4152163--