嵌入式JBoss與tomcat6整合

來源:互聯網
上載者:User

 原文:

http://docs.jboss.com/seam/latest/reference/en-US/html/configuration.html#config.install.embedded

 先下載嵌入式JBoss,

官方:http://sourceforge.net/projects/jboss/files/Embedded%20JBoss/Embedded%20JBoss%20Beta%203/

 在Tomcat6中嵌入JBoss的步驟很簡單。

 首先,你需要將嵌入JBoss的jar包和相關設定檔拷貝到tomcat中:

 1、 拷貝嵌入式JBoss中的bootstrap和lib目錄下的所有檔案和檔案夾到tomcat的lib中,jndi.propertis除外

 2、 刪除tomcat的lib下的annotations-api.jar檔案

接下來,有兩個設定檔需要修改,增加嵌入式JBoss特性

 3、 修改tomcat的conf/server.xml,添加一個監聽器EmbeddedJBossBootstrapListener, 必須添加在其他所有的監聽器後面

<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、 修改tomcat的conf/context.xml,增加war包掃描功能的監聽器WebinfScanner

<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、 如果是使用JDK6,還需要修改JAVA_OPTS環境變數,將sun.lang.ClassLoader.allowArraySyntax的值改為true,修改檔案:catalina.bat(Windows)或catalina.sh(Unix/Linux)

                開啟這個指令檔,在檔案最頂部的注釋的下面增加一行以設定JAVA_OPTS環境變數:

                Windows:

set JAVA_OPTS=%JAVA_OPTS% -Dsun.lang.ClassLoader.allowArraySyntax=true

                Linux/Unix:

JAVA_OPTS="$JAVA_OPTS -Dsun.lang.ClassLoader.allowArraySyntax=true"

更多配置選項,參見:

                嵌入式JBoss的tomcat整合http://wiki.jboss.org/wiki/Wiki.jsp?page=EmbeddedAndTomcat

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.