Chapter 5 Examples: EJB and JMS


To run the J2EE examples such as EJB and JMS, you need to set up the J2EE according to the following instruction.

1. Install J2EE

Get J2EE from Sun's website (http://java.sun.com/j2ee/) and install it.

ex) C:\j2sdkee1.3

2. Setup J2EE

  1. Set J2EE_HOME

    ex) set J2EE_HOME=C:\j2sdkee1.3

  2. You need to give all permissions to the Axis packages by replacing the default configuration for <j2ee-home>\lib\security\server.policy by the following description.

    grant {
        permission java.security.AllPermission;
    };

3. Run J2EE

Note that Sun's J2EE does not work with IBM's JDK.

  1. Change directory to examples.

    ex) cd c:\examples

  2. Run J2EE

    ex) bin\run-j2ee.bat -verbose

  3. Run cloudscape.bat

    ex) cloudscape.bat -start

  4. Add JMS Queue

    ex) %J2EE_HOME%\bin\j2eeadmin.bat -addJmsDestination MyQueue queue

  5. Run JMS listener

    ex) bin\run-JMSListener.bat

4. Deploy the example EAR files

  1. Run deploytool.bat

    ex) deploytool

  2. Deploy the following EAR files:

    Select [File]->[Open...] to open an EAR file. Select [Tools]->[Deploy...] to deploy the EAR file. You can exit the deploytool after deployment.

5. Open the JSP pages to run the example clients