jboss與tomcat的使用經驗總結

發表于:2007-06-21來源:作者:點擊數: 標簽:
一:jboss簡介 jboss是一套可以基于j2ee框架的全套 解決方案 ,他包括JBoss/Server,JBoss/spyderMQ, JBoss/Jaws ,JBoss/Zola,JBoss/Zoap,JBoss/Castor,JBoss/Tomcat。這些產品可以非常合理 的搭建基于j2ee框架的軟件產品和 軟件工程 。 雖然他的誕生才一年多,

   
  一:jboss簡介
jboss是一套可以基于j2ee框架的全套解決方案,他包括JBoss/Server,JBoss/spyderMQ, JBoss/Jaws ,JBoss/Zola,JBoss/Zoap,JBoss/Castor,JBoss/Tomcat。這些產品可以非常合理 的搭建基于j2ee框架的軟件產品和軟件工程。

雖然他的誕生才一年多,但是就像apache一樣,他是完全公開源代碼的,他是真正具有生命 力的產品的他將像其他免費軟件一樣成為成功的Application server。
本文主要是介紹如何安裝該軟件產品,如何配置他與Tomcat的結合,如何通過Tomcat的Servlet調用Ejb。最終完成Apache+Tomcat+jboss的Web綜合解決方案。我本人也是在上個星期天 才剛剛認識他的,短短的5天我也只是大概的了解了他的功能和特點。對他的大部分功能不是十分清楚,如果我有時間我會把有關jboss的其他內容逐步介紹給 大家,但不是現在。
好了現在開始我們的Apache+Tomcat+Jboss的旅程吧。
( 一)系統環境簡介:
硬件平臺:
PC 233 32M RAM 6GHand Disk
操作系統:
red head liunx 6.1 (由于jdk1.3的要求,必須使用6.1以上的版本,或者將glibc更新到2.1.2.11版本或更高。)
應用環境要求:
jdk1.3
jaxp1.0.1
Apache 3.1.2
Tomcat 3.2 beta 4 (jakarta-ant,jakarta-servletapi,jakarta-tomcat)
jBoss 2.0 BETA-PROD-PRE-05
interestEJB.tar.gz 測試EJB的源代碼。
安裝過程敘述如下:
假設當前目錄是:/home/liling
準備工作如下:
mkdir tomcat
mkdir jboss
cp j2sdk-1_3_0-linux-rpm.sh /home/liling/.
cp jakarta-ant.tar /home/liling/tomcat/.
cp jakarta-servletapi.tar /home/liling/tomcat/.
cp jakarta-tomcat.ta /home/liling/tomcat/.
cp jboss-cvs-sources.zip /home/liling/jboss
cp interestEJB.tar.gz /home/liling/jboss
一:安裝jdk1.3
sh j2sdk-1_3_0-linux-rpm.sh
rpm -iv j2sdk-1_3_0-linux-rpm
將看到/usr/java/jdk1.3目錄
JAVA_HOME = /usr/java/jdk1.3
PATH = $PATH:/usr/java/jdk1.3/bin
export JAVA_HOME
export PATH
jar -xvf jaxp-1_0_1.zip
將看到在當前目錄生成jaxp1.0.1目錄
CLASSPATH=$CLASSPAHT:/home/liling/jaxp-1.0.1/jaxp.jar:/home/liling/jaxp-1.0.1/parser.jar
export CLASSPATH
一:安裝Tomcat。
Tomcat的安裝過程包括安裝ant和servletapi的過程
首先將Tomcat的jakarta-tomcat.tar.gz解包。然后讀取README的過程安裝。
cd /home/liling/tomcat
gz -d jakarta-tomcat.tar.gz
tar -xvf jakarta-tomcat.tar
cd jakarta-tomcat
vi README
將看到如下安裝過程
cd $JAKARTA_HOME/jakarta-ant
./bootstrap.sh <-- Unix
This should result in the creation of a file "ant.jar" in the "lib"
subdirectory, which will be used when building Watchdog.
cd $JAKARTA_HOME/jakarta-servletapi
./build.sh dist <-- Unix
This should result in the creation of a file "servlet.jar" in the "lib"
subdirectory, which will be used when building Watchdog.
cd $JAKARTA_HOME/jakarta-tomcat
./build.sh <-- Unix

按照上面的過程完成安裝將會出現下面的目錄:
./build
./build/ant
./build/serletapi
./build/tomcat
./dist
./dist/servletapi/lib
在./build/tomcat/bin/startup.sh和./build/tomcat/bin/shutdown.sh 用于啟動和停止tomcat。
二:安裝jboss。
配置TOMCAT_HOME環境變量:
TOMCAT_HOME=/home/liling/tomcat/build/tomcat
export TOMCAT_HOME
cd /home/liling/jboss
jar -xvf jboss-cvs-sources.zip
cd src
cd build
./build.sh
三:啟動jboss:
cd /home/liling/jboss/dist/bin/
/run.sh
四:配置Tomcat與Jboss
cd /home/liling/jboss/dist/conf
vi jboss.conf
會看到如下提示:
<!-- -- Uncomment this to add "Integrated Stack (fast) Tomcat support".
-- This service allows you to integrate the stack of Tomcat and jboss.
-- Invocations are not going through.network but pass native pointers resulting in dramatic speed increases.
-- This service allows the J2EE deployer to add and remove Tomcat contexts dynamically
-- through JMX for you and in effect deploy EARs. Note that tomcat´s server.xml file will not be processed:
-- you can only use JMX to add contexts. Use the J2EE deployer to deploy full EARs on this stack
-- Be sure to set your ´TOMCAT_HOME´ environment variable before starting JBoss.
--
-- The ARG tag is the port to run tomcat on.
--
-- MLET CODE = "org.jboss.tomcat.EmbeddedTomcatService" ARCHIVE="jboss.jar" CODEBASE="../../lib/ext/">
-- ARG TYPE="int" VALUE=8080>
-- /MLET>
-->
在上面的提示下添加下面的內容
< MLET CODE = "org.jboss.tomcat.EmbeddedTomcatService" ARCHIVE="jboss.jar" CODEBASE="../../lib/ext/" >
< ARG TYPE="int" VALUE=8088 >
< /MLET >
還會看到下面的提示:
< !--
-- Uncomment this to add "Stand-alone Stack Tomcat support".
-- This means that JSP and Servlets will work with EJB in different stacks and
-- communicate through network invocation. If you benchmark j2ee please use "integrated stack".
-- Also note that you cannot use the J2EE deployer with Tomcat in this configuration.
-- Be sure to set your ´TOMCAT_HOME´ environment variable before starting JBoss.
-- Note: this reads the server.xml configuration file of Tomcat, you can´t use the j2ee deployer
--
-- MLET CODE = "org.jboss.tomcat.TomcatService"
ARCHIVE="jboss.jar" CODEBASE="../../lib/ext/" >
-- /MLET >
-- >
在上面的提示下添加如下內容:
< MLET CODE = "org.jboss.tomcat.EmbeddedTomcatService" ARCHIVE="jboss.jar" CODEBASE="../../lib/ext/" >
< ARG TYPE="int" VALUE=8088 >
< /MLET >
現在在啟動jboss可以看到如下提示:
[EmbeddedTomcat] Starting
[EmbeddedTomcat] Testing if Tomcat is present....
[EmbeddedTomcat] OK
[EmbeddedTomcat] ContextManager: Adding context Ctx( )
[EmbeddedTomcat] path="" :jsp: init
[EmbeddedTomcat] PoolTcpConnector: Starting HttpConnectionHandler on 8088
[EmbeddedTomcat] Started
這表示Integrated Stack (fast) Tomcat support已經啟動成功。
[Tomcat] Initializing
[Tomcat] Initialized
[Tomcat] Starting
[Tomcat] Testing if Tomcat is present....
[Tomcat] OK
[Tomcat] Starting Tomcat...
[Tomcat] Starting tomcat. Check logs/tomcat.log for error messages
2000-11-21 08:26:02 - ContextManager: Adding context Ctx( /examples )
2000-11-21 08:26:02 - ContextManager: Adding context Ctx( /admin )
2000-11-21 08:26:02 - ContextManager: Adding context Ctx( )
2000-11-21 08:26:02 - ContextManager: Adding context Ctx( /test )
2000-11-21 08:26:04 - PoolTcpConnector: Starting HttpConnectionHandler on 8080
[Tomcat] Started
這表示Stand-alone Stack Tomcat support已經啟動。
liling
11.15

原文轉自:http://www.anti-gravitydesign.com

国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97