activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neek <>
Subject Starting WebConsole .war in embedded Jetty and vm:// broker.. JNDI config?
Date Wed, 25 May 2011 04:10:08 GMT
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  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 which went smoothly, the jndi
file says:

java.naming.factory.initial =

java.naming.provider.url = vm://myapp

connectionFactoryNames = connectionFactory

queue.testqueue = myapp.testqueue

This 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 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:

However the webconsole war fails init:

     [java] WARNING: Failed startup of context
     [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
threw exception; nested exception is java.lang.IllegalArgumentException:
Neither a ConnectionFactory nor a JMS-url were specified
     [java]     at

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:

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

Any clues? :)

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message