[mule-user] Embedding Mule within Tomcat

0 views
Skip to first unread message

bobs99

unread,
Apr 3, 2009, 9:52:06 AM4/3/09
to us...@mule.codehaus.org

Hi

I'm relatively new to Mule and I'm trying to run Mule 2.2.1 embedded within
Tomcat 6.0.18.

As documented in the Mule users manual, I've configured my web.xml in
WEB-INF with:

<context-param>
<param-name>org.mule.config</param-name>
<param-value>my-mule-config.xml</param-value>
</context-param>

and set up a listener ...

<listener>

<listener-class>org.mule.config.builders.MuleXmlBuilderContextListener</listener-class>
</listener>

But when I start up Tomcat, I get the following class not found error:

SEVERE: Error configuring application listener of class
org.mule.config.builders.MuleXmlBuilderContextListener
java.lang.ClassNotFoundException:
org.mule.config.builders.MuleXmlBuilderContextListener
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
...

Clearly the 'MuleXmlBuilderContextListener' class can't be found.

Should I resolve this by downloading and adding the
'mule-2.2.1-embedded.jar' into my web app, WEB-INF/lib? If I do this, the
class is now found OK, but I also need to add many Spring and misc jars,
etc.

Is the the correct way to embed Mule within Tomcat - or is this totally the
wrong approach?

Any help/guidance much appreciated?

--
View this message in context: http://www.nabble.com/Embedding-Mule-within-Tomcat-tp22868834p22868834.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Andrew Perepelytsya

unread,
Apr 3, 2009, 10:37:42 AM4/3/09
to us...@mule.codehaus.org
Did you add those jars to the webapp initially?

Andrew

Andrew Perepelytsya

unread,
Apr 3, 2009, 11:39:15 AM4/3/09
to bob_s...@yahoo.co.uk, mule-user
The easiest manual way to start is to grab Mule jars from lib/mule and lib/opt and put them in WEB-INF/lib.

Once you want to do it properly, you can e.g. package your WAR with maven. Then you only put mule modules you need in pom.xml, and maven fetches all required dependencies and packages them in a war. Standard maven war packaging and archetype work great.

HTH,
Andrew

On Fri, Apr 3, 2009 at 11:16 AM, <bob_s...@yahoo.co.uk> wrote:
Hi Andrew

Initially, I added no Mule jars to Tomcat and got the class not found errors, previously described when I started Tomcat. I then downloaded and added the mule-2.2.1-embedded.jar and deployed into my web app directory WEB-INF/lib.

As already stated, I then had to deploy further spring jars, and so on, to get Tomcat to start without the class not found errors.

It seems to me I must be trying to embed Mule into Tomcat in totally the wrong way here, as looking through the forum I don't see any similar problems listed.

So, how should it be done?



Andrew Perepelytsya wrote:
>
> Did you add those jars to the webapp initially?
>
> Andrew
>
>

Nicholas Chow

unread,
Jul 1, 2009, 3:29:40 AM7/1/09
to us...@mule.codehaus.org
i have grabbed Mule jars from lib/mule and lib/opt and put them in WEB-INF/lib.and i put mule-2.2.1-embedded.jar into WEB-INF\lib,add following xml into my web.xml
"
<context-param>
<param-name>org.mule.config</param-name>
<param-value>mule-config-main.xml,mule-components.xml</param-value>
</context-param>

<listener>
<listener-class>org.mule.config.builders.MuleXmlBuilderContextListener</listener-class>
</listener>

" .then i start my tomcat,but error:
2009-7-1 15:22:48 org.apache.catalina.core.StandardContext start
&#20005;&#37325;: Error listenerStart
2009-7-1 15:22:48 org.apache.catalina.core.StandardContext start
&#20005;&#37325;: Context [/mule] startup failed due to previous errors

the listener is error.but i have added the mule-2.2.1-embedded.jar.
u said,"Once you want to do it properly, you can e.g. package your WAR with maven.
Then you only put mule modules you need in pom.xml",i don't know how to do.Could you describe it in detail?give a example is better.
thanks.

Nicholas Chow

unread,
Jul 5, 2009, 11:41:45 PM7/5/09
to us...@mule.codehaus.org
i have embedded mule tinto application,and deployed the application successful.mule exaples have the example webapp.the example tells me how to embed mule into application.

Salman Qureshi

unread,
Sep 16, 2009, 1:16:11 AM9/16/09
to us...@mule.codehaus.org
Hi Nicholas,

I am looking to embed Mule in my Spring app. Could you tell me how you were able to achieve the integration and/or which example webapp did you refer to in your post.

Thanks,
Salman

Reply all
Reply to author
Forward
0 new messages