I. Introduction
JBoss is Open Source, completely free AppLiaction Server, has good support for J2EE, and can be combined with Tomcat.
Second, download, install
The download address is a JBoss official site: http://www.jboss.org/, I downloaded JBoss2, and with Tomcat, avoiding a single download together. Problem. The download address is: http://www.jboss.org/jboss_tomcat.zip
Download, unzip it to a directory, I use E: / jboss_tomcat as an example here. There is a subdirectory below:
E: / jboss_tomcat / jboss2
with
E: / jboss_tomcat / tomcat32b7
Note that I have changed slightly here, so if you don't add Tomcat_Home to classpath, E: /JBOSS_TOMCAT/JBOSS2/BIN/Run_With_Tomcat.bat This file should be changed accordingly.
Third, configuration operation
Basically don't configure it, just install JDK, of course, it is best to add Tomcat_Home to classpath.
In this way, E: /JBOSS_TOMCAT/JBoss2/bin/run_with_tomcat.bat can remove Tomcat_home before this file.
Run E: /JBOSS_TOMCAT /JBOSS2/BIN/Run_With_tomcat.bat This file, this, Tomcat port is 8080, JBoss is 8083,
Run http: // localhost: 8080 / Tomcat Home,
Run http: // localhost: 8083 / Unparalleled blank page,
Fourth, test EJB
(1) Start JBoss:
See the method:
(2) Download code:
http://www.wodejia.net/softdownload/java/interestejb.zip
Separate, the following directory appears:
Interest / COM
INTEREST / DOCS
...
All COPY to JBoss2 Examples Directory, if there is no Examples directory, create one, the structure is as follows:
E: / jboss_tomcat / jboss2 / examples / intend / ...
Copy file E: /JBOSS_TOMCAT/JBoss2/examples/interest/interest.jar to:
E: / jboss_tomcat / jboss2 / deploy:
Add the following files in ClassPath:
E: /JBOSS_TOMCAT / TOMCAT32B7/LIB/Servlet.jar; E: /JBOSS/Client/Jboss-client.jar; E: /JBOSS/Client/jnp-client.jar; E: / JBoss / LIB / EXT / EJB. Jar; e: /jboss/examples/interest/interest-client.jar
To test the client to call EJB through servlet, you must: E: / JBOSS_TOMCAT / JBOSS2 / EXAMPLES / INTEREST / EJB.CLASS and EJB.JAVA copy to:
E: / jboss_tomcat / tomcat32b7 / webapps / root / web-inf / class under directory
Restart JBoss_Tomcat
(3) CLIENT test operation under Command:
Under Command, enter the directory E: / jboss_tomcat / jboss2 / example / intendjava interestclient will appear:
Got Context
Got Reference
Interest on 1000 Units, AT 10% Period, Compounded over 2 Periods IS: 210.00000000000023
The JBOSS window will appear:
[INTEREST] Someone Called `CalculateCompoundINTEREST! '
(4) Web Client runs through the servlet test:
http: // cgreen: 8080 / servlet / ejb
Will appear:
Interest on 1000 Units, AT 10% Period, Compounded over 2 Periods IS: 210.00000000000023
The JBOSS window will appear:
[INTEREST] Someone Called `CalculateCompoundINTEREST! '
It has been successful. From http://www.zhirui.com/it/2004/8-5/2866.html