[mule-user] Unable to embed Mule 3.0.1 in JBoss 5.1.0.GA

5 views
Skip to first unread message

Tor J. Johannessen

unread,
Feb 10, 2011, 3:40:07 PM2/10/11
to us...@mule.codehaus.org
I'm trying to embed Mule as a web app in JBoss. I've followed the instructions in [Embedding Mule in a Java Application or Webapp|http://www.mulesoft.org/documentation/display/MULE3USER/Embedding+Mule+in+a+Java+Application+or+Webapp] .

When starting JBoss, TomcatDeployment starts to load Mule, but after a short time nothing more happens. After about 30 min. a "java.lang.OutOfMemoryError: GC overhead limit exceeded" occurs. See the attached +jboss_log.txt+ file.

*My JBoss memory config is as follows (but I don't think that causes the problem):-Xms256M -Xmx640M -XX:MaxPermSize=384M.
*The structure of my mule.war is as shown in the attached +mule_war.png+ file
*The configuration file for the web archive is as shown in the attached +web.xml+ file
*The mule configuration file is as shown in the attached file +mule-config.xml+ file (the configuration is simplified to make sure it is not the cause of the problem - I have also tried simpler/more complex ones)
*I also had to put libraries from +mule/lib/opt+ and +mule/lib/mule+ into +jboss/server/default/lib+ to remove numerous ClassNotFoundExceptions (see attached +jboss-server-default-lib.png+ file)

PS! The more complex mule-configuration I tried first, works perfectly well on a standalone mule installation...

Can anybody please tell me what I'm doing wrong?

jboss-server-default-lib.png
mule-config.xml
web.xml
mule_war.png
jboss_log.txt

suneet Shah

unread,
Feb 10, 2011, 4:05:38 PM2/10/11
to us...@mule.codehaus.org
We use the following settings when deploying mule on to jboss 5.1

set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m

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

http://xircles.codehaus.org/manage_email


Tor J. Johannessen

unread,
Feb 11, 2011, 2:43:13 AM2/11/11
to us...@mule.codehaus.org
Increasing the memory to the suggested values gives me the following error while loading Mule:
{noformat}}
08:35:20,467 WARN [ClassLoaderManager] Unexpected error during load of:org.mule.api.MuleContext
java.lang.OutOfMemoryError
at java.util.zip.Inflater.init(Native Method)
at java.util.zip.Inflater.<init>(Inflater.java:83)
at java.util.zip.ZipFile.getInflater(ZipFile.java:279)
at java.util.zip.ZipFile.getInputStream(ZipFile.java:225)
at java.util.zip.ZipFile.getInputStream(ZipFile.java:193)
at org.jboss.virtual.plugins.context.zip.ZipFileWrapper.openStream(ZipFileWrapper.java:214)
at org.jboss.virtual.plugins.context.zip.ZipEntryContext.openStream(ZipEntryContext.java:1082)
at org.jboss.virtual.plugins.context.zip.ZipEntryHandler.openStream(ZipEntryHandler.java:153)
at org.jboss.virtual.VirtualFile.openStream(VirtualFile.java:230)
at org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy.getResourceAsStream(VFSClassLoaderPolicy.java:483)
at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:534)
at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:530)
at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:507)
at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134)
at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)
at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:452)
at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:251)
at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:150)
at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:265)
at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1119)
at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:798)
at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:441)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.mule.config.processors.DecoratingAnnotatedServiceProcessor.setMuleContext(DecoratingAnnotatedServiceProcessor.java:88)
at org.mule.config.processors.DecoratingAnnotatedServiceProcessor.<init>(DecoratingAnnotatedServiceProcessor.java:80)
at org.mule.config.spring.processors.DecoratingFlowAnnotationsBeanProcessor.setMuleContext(DecoratingFlowAnnotationsBeanProcessor.java:29)
at org.mule.config.spring.MuleContextPostProcessor.postProcessBeforeInitialization(MuleContextPostProcessor.java:46)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
{noformat}}

Tor J. Johannessen

unread,
Feb 11, 2011, 3:34:06 AM2/11/11
to us...@mule.codehaus.org
I've thrown out +mule-3.0.1-embedded.jar+ and started using libraries from +mule/lib/mule+ and +mule/lib/opt+ only (putting them in +jboss/server/default/lib+). No I've got JBoss started with Mule telling it's up and running. Look promising. Now I've to test it with the original mule configuration...

Tor J. Johannessen

unread,
Feb 11, 2011, 5:23:08 AM2/11/11
to us...@mule.codehaus.org
Well, now Mule starts, telling that both HttpPollingConnector and JmsConnector are up and running. But nothing ever happens. Is it not possible to use these connectors from within JBoss, or what might the problem be?

Tor J. Johannessen

unread,
Feb 11, 2011, 7:01:38 AM2/11/11
to us...@mule.codehaus.org
I've now repacked my application and put all the mule libraries in the +WEB-INF/lib+ folder in the web archive (moved from +jboss/server/default/lib+) and the HttpPollingConnector seems to be working - YEAH.

Unfortunately, the xslt transformation (that worked in Mule standalone) does not work, but I guess that has something to do with the following warning:
{code}
12:32:41,056 WARN [XsltTransformer] Preferred Transfomer Factory net.sf.saxon.TransformerFactoryImpl not on classpath and no default is set, defaulting to JDK
{code}
So I will add the saxon transformer and try again

Tor J. Johannessen

unread,
Feb 11, 2011, 8:50:54 AM2/11/11
to us...@mule.codehaus.org
It works!

See the attached file for the content of the web archive.

To find out which libraries to include, I included one library, started JBoss, looked for the ClassNotFoundException, added another library, and so on.

To search for the library containing the class, i used [JarScan|http://www.inetfeedback.com/jarscan]

Some of the errors I got was different, like:
{code}
09:51:40,626 ERROR [STDERR] Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesoft.org/schema/mule/jms]
Offending resource: resources/config/mule-config.xml
{code}
I then looked for a Mule library matching the url in the errormessage, in this case jms - which meant I was missing +mule-transport-jms-3.0.1.jar+

mule_war_2.png

Tor J. Johannessen

unread,
Feb 11, 2011, 8:54:18 AM2/11/11
to us...@mule.codehaus.org
I still get the +LifecycleException+ when shutting down JBoss, but it doesn't seem to matter...

Andrew Perepelytsya

unread,
Feb 11, 2011, 9:18:48 AM2/11/11
to us...@mule.codehaus.org
Using maven to build your project would be a life-saver for you - no more 'guessing' which one to include.

For a while my favorite repo search tool has been the recently launched http://mavencentral.sonatype.com - very clean and faster than anything out there (yes, class search is available, see Advanced Search).

HTH,
Andrew

Tor J. Johannessen

unread,
Feb 14, 2011, 3:40:13 AM2/14/11
to us...@mule.codehaus.org
We are using Ant, as you probably have guessed. We have considered converting to Maven, but found out that it would have taken to long, compared to what we would have gained. I can see that we, in this case, could have saved some of work...
I'll check out this other Jar scanner.
Reply all
Reply to author
Forward
0 new messages