You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by lyall <Ly...@The-Pearces.com> on 2009/09/30 09:38:41 UTC

Howto Run ActiveMQ 5.2 in Tomcat 6 on Windows?

I am looking for a simple, step by step, howto, to setup ActiveMQ with the
web console, running in Tomcat 6.

Where can I find one?

I already have a standalone configuration of ActiveMQ working just fine.
I want to move ActiveMQ into Tomcat.

I have setup Tomcat.
I have copied the activemq-all-5.2.0.jar into the tomcat\lib directory
I have deployed the activemq-web-console-5.2.0.war
I have edited the tomcat\bin\startup.bat file to include

 set JAVA_OPTS="-Dwebconsole.type=properties
-Dwebconsole.jms.url=tcp://localhost:61616
-Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector
-Dwebconsole.jmx.role=  -Dwebconsole.jmx.password=
-Dactivemq.username=system -Dactivemq.password=manager"

Although, I admit I would be happier with jndi settings but I am only a
beginner at Tomcat configuration. I think I would prefer to set it up in the
conf/context.xml but don't know how.

The ActiveMQ web console shows up as an application, but fails to start,
with the following helpful error.

INFO: Deploying web application archive activemq-web-console-5.2.0.war
2009-09-30 16:57:39,463 [main           ] DEBUG WebConsoleStarter             
- Initializing ActiveMQ WebConsole...
Sep 30, 2009 4:57:39 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Sep 30, 2009 4:57:39 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/activemq-web-console-5.2.0] startup failed due to previous
errors

I have tried copying all the activemq/conf files into the
tomcat\webapps\activemq-web-console-5.2.0\WEB-INF directory, although, I
admit to being uncomfortable with that - there must be a better way.

I also admit to being a but cautious about editing the tomcat startup
script.

Can anyone point me in the right direction?

...Lyall

-- 
View this message in context: http://www.nabble.com/Howto-Run-ActiveMQ-5.2-in-Tomcat-6-on-Windows--tp25676368p25676368.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Howto Run ActiveMQ 5.2 in Tomcat 6 on Windows?

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi,

you should use properties only if you wish to connect to the standalone
broker.

To start your own broker inside the tomcat, you should remove JAVA_OPTS from
your startup file.

Copy this file to your WEB-INF/webconsole-embedded.xml

http://svn.apache.org/viewvc/activemq/trunk/activemq-web-console/src/main/webapp/WEB-INF/webconsole-embedded.xml?view=co&content-type=text%2Fplain

and place your activemq.xml inside your WEB-INF folder.

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Thu, Oct 1, 2009 at 6:24 AM, lyall <Ly...@the-pearces.com> wrote:

>
> Gradually making progress, I can run up the ActiveMQ Web Console within
> tomcat.
>
> I was running ActiveMQ as a stand-alone broker, I am trying to setup the
> stand-alone broker, in Tomcat.
> To that end, I can't seem to figure out where I should put the
> 'activemq.xml' configuration, that I was using in the stand-alone broker.
> Basically, I can start up the stand-alone broker, browse to the admin page
> and and see queues, etc. The stand-alone broker is configured to talk to
> other brokers, not use discovery.
>
> I want to duplicate that functionality within Tomcat. I figure I would need
> to put the activemq/conf/* files somewhere.
>
> For those that are interested, the steps I took to get the activemq console
> to work in tomcat 6.0.20 on windows are...
>
>    * Download and install Tomcat 6 Windows Service Installer
>    * Download ActiveMQ and extract to a temporary location
>    * Download the activemq-web-console WAR (find the link in the Example
> configuration using Tomcat section of
> http://activemq.apache.org/web-console.html).
>
> Install Tomcat 6
>
>    * Execute the Tomcat Installer
>    * Edit $CATALINA_HOME/conf/tomcat-users.xml to look like the following
>
> File: $CATALINA_HOME/conf/tomcat-users.xml
>
> <?xml version='1.0' encoding='utf-8'?>
> <tomcat-users>
>  <role rolename="manager"/>
>  <role rolename="admin"/>
>  <user username="admin" password="admin" roles="admin,manager"/>
> </tomcat-users>
>
>    * Start Tomcat (Start->All Programs->Apache Tomcat 6.0->Monitor Tomcat)
>          o If it is not showing the little green triangle, right click it
> and start it.
>    * Browse to the tomcat admin page (Start->All Programs->Apache Tomcat
> 6.0->Tomcat Manager)
>    * Login with user/password, as shown in the tomcat-users.xml file
>
> ActiveMQ Deployment
>
>    * Stop Tomcat
>    * Copy $ACTIVEMQ_HOME/activemq-all-5.2.0.jar into $CATALINA_HOME/lib
>    * Start Tomcat (Start->All Programs->Apache Tomcat 6.0->Monitor Tomcat)
>          o If it is not showing the little green triangle, right click it
> and start it.
>    * Deploy ActiveMQ Web Console
>          o At the bottom of the manager page, browse to the ActiveMQ Web
> Console .war file, in the temporary location and deploy it.
>    * Shutdown Tomcat (right click the systray green triangle)
>    * Create
> $CATALINA_HOME/conf/Catalina/localhost/activemq-web-console-5.2.0.xml
>
> File: $CATALINA_HOME/conf/Catalina/localhost/activemq-web-console-5.2.0.xml
>
> <?xml version='1.0' encoding='utf-8'?>
> <!--
>  Licensed to the Apache Software Foundation (ASF) under one or more
>  contributor license agreements.  See the NOTICE file distributed with
>  this work for additional information regarding copyright ownership.
>  The ASF licenses this file to You under the Apache License, Version 2.0
>  (the "License"); you may not use this file except in compliance with
>  the License.  You may obtain a copy of the License at
>
>      http://www.apache.org/licenses/LICENSE-2.0
>
>  Unless required by applicable law or agreed to in writing, software
>  distributed under the License is distributed on an "AS IS" BASIS,
>  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>  See the License for the specific language governing permissions and
>  limitations under the License.
> -->
> <!-- The contents of this file will be loaded for each web application -->
> <Context>
>
>    <!-- Default set of monitored resources -->
>    <WatchedResource>WEB-INF/web.xml</WatchedResource>
>
>    <!-- Uncomment this to disable session persistence across Tomcat
> restarts -->
>    <!--
>    <Manager pathname="" />
>    -->
>
>    <!-- Uncomment this to enable Comet connection tacking (provides events
>         on session expiration as well as webapp lifecycle) -->
>    <!--
>    <Valve
> className="org.apache.catalina.valves.CometConnectionManagerValve" />
>    -->
>
>  <Resource name="jms/ConnectionFactory"
> auth="Container"
> type="org.apache.activemq.ActiveMQConnectionFactory"
> description="JMS Connection Factory"
> factory="org.apache.activemq.jndi.JNDIReferenceFactory"
> brokerURL="tcp://localhost:61616"
> brokerName="LocalActiveMQBroker"
> useEmbeddedBroker="false"
> UserName="system"
> Password="manager"/>
>
>    <!--
>    <Resource name="jms/topic/MyTopic"
>        auth="Container"
>        type="org.apache.activemq.command.ActiveMQTopic"
>        factory="org.apache.activemq.jndi.JNDIReferenceFactory"
>        physicalName="MY.TEST.FOO"/>
>    <Resource name="jms/queue/MyQueue"
>        auth="Container"
>        type="org.apache.activemq.command.ActiveMQQueue"
>        factory="org.apache.activemq.jndi.JNDIReferenceFactory"
>        physicalName="MY.TEST.FOO.QUEUE"/>
>     -->
> </Context>
>
>    * The admin console will still fail, at this point, with "This absolute
> uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml
> or
> the jar files deployed with this application,"
>    * The solution was identified in this forum topic
> (http://forums.sun.com/thread.jspa?threadID=486791)
>          o Download
>
> http://www.apache.org/dist/jakarta/taglibs/standard/jakarta-taglibs-standard-current.zip
>          o Extract jstl.jar and standard.jar
>          o Copy them into $CATALINA_HOME/lib
>    * Start Tomcat
>    * Browse to the activemq-web-console application.
>
> TODO:
>
>    * The activemq server is not taking the configuration I want
>    * The activemq server is storing it's data in C:\Program Files\Apache
> Software Foundation\Tomcat 6.0\activemq-data
>
>
> --
> View this message in context:
> http://www.nabble.com/Howto-Run-ActiveMQ-5.2-in-Tomcat-6-on-Windows--tp25676368p25692906.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Re: Howto Run ActiveMQ 5.2 in Tomcat 6 on Windows?

Posted by lyall <Ly...@The-Pearces.com>.
Gradually making progress, I can run up the ActiveMQ Web Console within
tomcat.

I was running ActiveMQ as a stand-alone broker, I am trying to setup the
stand-alone broker, in Tomcat.
To that end, I can't seem to figure out where I should put the
'activemq.xml' configuration, that I was using in the stand-alone broker.
Basically, I can start up the stand-alone broker, browse to the admin page
and and see queues, etc. The stand-alone broker is configured to talk to
other brokers, not use discovery.

I want to duplicate that functionality within Tomcat. I figure I would need
to put the activemq/conf/* files somewhere.

For those that are interested, the steps I took to get the activemq console
to work in tomcat 6.0.20 on windows are...

    * Download and install Tomcat 6 Windows Service Installer
    * Download ActiveMQ and extract to a temporary location
    * Download the activemq-web-console WAR (find the link in the Example
configuration using Tomcat section of
http://activemq.apache.org/web-console.html). 

Install Tomcat 6

    * Execute the Tomcat Installer
    * Edit $CATALINA_HOME/conf/tomcat-users.xml to look like the following

File: $CATALINA_HOME/conf/tomcat-users.xml

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="admin" password="admin" roles="admin,manager"/>
</tomcat-users>

    * Start Tomcat (Start->All Programs->Apache Tomcat 6.0->Monitor Tomcat)
          o If it is not showing the little green triangle, right click it
and start it. 
    * Browse to the tomcat admin page (Start->All Programs->Apache Tomcat
6.0->Tomcat Manager)
    * Login with user/password, as shown in the tomcat-users.xml file 

ActiveMQ Deployment

    * Stop Tomcat
    * Copy $ACTIVEMQ_HOME/activemq-all-5.2.0.jar into $CATALINA_HOME/lib
    * Start Tomcat (Start->All Programs->Apache Tomcat 6.0->Monitor Tomcat)
          o If it is not showing the little green triangle, right click it
and start it. 
    * Deploy ActiveMQ Web Console
          o At the bottom of the manager page, browse to the ActiveMQ Web
Console .war file, in the temporary location and deploy it. 
    * Shutdown Tomcat (right click the systray green triangle)
    * Create
$CATALINA_HOME/conf/Catalina/localhost/activemq-web-console-5.2.0.xml

File: $CATALINA_HOME/conf/Catalina/localhost/activemq-web-console-5.2.0.xml

<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
	
    <!-- Uncomment this to disable session persistence across Tomcat
restarts -->
    <!--
    <Manager pathname="" />
    -->

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve
className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->

 <Resource name="jms/ConnectionFactory" 
auth="Container" 
type="org.apache.activemq.ActiveMQConnectionFactory" 
description="JMS Connection Factory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory" 
brokerURL="tcp://localhost:61616" 
brokerName="LocalActiveMQBroker"
useEmbeddedBroker="false"
UserName="system"
Password="manager"/>

    <!--
    <Resource name="jms/topic/MyTopic"
        auth="Container"
        type="org.apache.activemq.command.ActiveMQTopic"
        factory="org.apache.activemq.jndi.JNDIReferenceFactory"
        physicalName="MY.TEST.FOO"/>
    <Resource name="jms/queue/MyQueue"
        auth="Container"
        type="org.apache.activemq.command.ActiveMQQueue"
        factory="org.apache.activemq.jndi.JNDIReferenceFactory"
        physicalName="MY.TEST.FOO.QUEUE"/>
     -->
</Context>

    * The admin console will still fail, at this point, with "This absolute
uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or
the jar files deployed with this application,"
    * The solution was identified in this forum topic
(http://forums.sun.com/thread.jspa?threadID=486791)
          o Download
http://www.apache.org/dist/jakarta/taglibs/standard/jakarta-taglibs-standard-current.zip
          o Extract jstl.jar and standard.jar
          o Copy them into $CATALINA_HOME/lib 
    * Start Tomcat
    * Browse to the activemq-web-console application. 

TODO:

    * The activemq server is not taking the configuration I want
    * The activemq server is storing it's data in C:\Program Files\Apache
Software Foundation\Tomcat 6.0\activemq-data 


-- 
View this message in context: http://www.nabble.com/Howto-Run-ActiveMQ-5.2-in-Tomcat-6-on-Windows--tp25676368p25692906.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.