Original article:
Http://docs.jboss.com/seam/latest/reference/en-US/html/configuration.html#config.install.embedded
First download the embedded JBoss,
Http://sourceforge.net/projects/jboss/files/Embedded%20JBoss/Embedded%20JBoss%20Beta%203/
It is easy to embed JBoss in Tomcat 6.
First, you need to copy the jar package and related configuration files embedded in JBoss to Tomcat:
1. Copy all the files and folders in the bootstrap and Lib directories in the embedded JBoss directory to Tomcat Lib, except for JNDI. propertis.
2. Delete the annotations-api.jar file under Tomcat lib
Next, two configuration files need to be modified to add the embedded JBoss feature.
3. Modify CONF/server. xml of Tomcat and add a listener embeddedjbossbootstraplistener,Must be added after all other listeners.
<Server port="8005" shutdown="SHUTDOWN"><!-- Comment these entries out to disable JMX MBeans support used for the administration web application --><Listener className="org.apache.catalina.core.AprLifecycleListener" /><Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /><Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /><Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener" /><!-- Add this listener --><Listener className="org.jboss.embedded.tomcat.EmbeddedJBossBootstrapListener" />
4. Modify the conf/context. xml of Tomcat and add the webinfenders listener for the war package scan function.
<Context><!-- Default set of monitored resources --><WatchedResource>WEB-INF/web.xml</WatchedResource><!-- Uncomment this to disable session persistence across Tomcat restarts --><!--<Manager pathname="" />--> <!-- Add this listener --> <Listener className="org.jboss.embedded.tomcat.WebinfScanner" /></Context>
5. If JDK 6 is used, you also need to modify the java_opts environment variable and set. lang. classloader. change allowarraysyntax to true. Modify the file Catalina. BAT (Windows) or Catalina. sh (Unix/Linux)
Open the script file and add a line below the comment at the top of the file to set the java_opts environment variable:
Windows:
set JAVA_OPTS=%JAVA_OPTS% -Dsun.lang.ClassLoader.allowArraySyntax=true
Linux/Unix:
JAVA_OPTS="$JAVA_OPTS -Dsun.lang.ClassLoader.allowArraySyntax=true"
For more configuration options, see:
Embedded JBoss Tomcat integrated http://wiki.jboss.org/wiki/Wiki.jsp? Page = embeddedandtomcat