JBoss - Petstore Installation/Setup Guide

JBoss Version: 3.0.1 RC1
Petstore Version: 1.1.2
J2SE Version: 1.4
J2EE Version: 1.3.1
Java Pet Store Application Version: 1.1.2

I. Download Software

1. Download  Java 2 Standard Edition 1.4 SDK

2. Download Java 2 Enterprise Edition 1.3.1 SDK

3. Download JBoss application server source code:

4. Download Java Petstore Sample Application

5. Download the JBoss Pet Store patch file

II. Unpack and Install Software

1. Install the J2SE SDK.  Follow instructions on site:

2. Install the J2EE SDK.  Follow instructions on site:

3. Unpack the JBoss software anywhere on your home directory:
    gunzip jboss-3.0.1RC1-src.tgz
    tar -xvf jboss-3.0.1RC1.tar

    The root directory of the JBoss source installation will be referred to as $JBOSS_SOURCE

4. Build the JBoss application server
    cd $JBOSS_SOURCE/build
    sh build.sh

    Application will probably compile with warnings... just ignore. Within the build directory, an output directory should have been created.  Change directory to this output directory:

    cd output

Within the output directory is the JBoss installation.  From now on this directory will be referred to as $JBOSS_HOME

5. Unzip the Java Petstore anywhere in your home directory:

        unzip jps-1_1_2.zip

The root directory of the Pet Store demo will be referred to below as $PETSTORE

6. Install the JBoss Pet Store patch file: Copy jps-rr-patch.tar to root directory $PETSTORE of the the pet store installation.  Change to the this directory and untar the file.  Select replace [A]ll when prompted.

    cd $PETSTORE
    tar -xvf jps-rr-patch.tar

III. Set up Environment

This environment assumes that you are using csh as your shell.  Make similar modifications for other shells such as bash.

1. Open up your .cshrc file

2. Add the following environment variables:

         setenv JAVA_HOME [directory where you installed j2sdk] ex: "/usr/java/j2sdk1.4.0"
    setenv J2EE_HOME [directory where you installed j2sdkee] ex: "/usr/java/j2sdkee1.3.1"
    setenv JBOSS_HOME [directory where you jboss was compiled] "~/jboss-3.0.1RC1-src/build/output/jboss-3.0.1RC1"

Your PATH should also include the bin directories of the J2EE SDK and J2SE

3. Save and close file

4. Refresh environment:
    source .cshrc

IV. Modify Pet Store Application

1. Rebuild Pet Store application:

    cd $PETSTORE/src/petstore/src
    sh build.sh

V. Deploy Application

1. Copy cloudscape-service.xml to $JBOSS_HOME/server/default/deploy directory:

    cp cloudscape-service.xml $JBOSS_HOME/server/default/deploy

2. Copy login-config.xml to $JBOSS_HOME/server/default/conf directory.  Replace the current login.xml file.

  cp login-config.xml $JBOSS_HOME/server/default/conf

3. Change directory to $JBOSS_HOME/server/default/conf directory:

  cd $JBOSS_HOME/server/default/conf

  Edit the "jboss-minimal.xml" and "jboss-service.xml" files.  Change the port number for the NamingService from 1099 to 1097.  This change is needed because of port conflicts between cloudscape and the JBoss naming service:


  <mbean code="org.jboss.naming.NamingService"
    <attribute name="Port">1099</attribute>


  <mbean code="org.jboss.naming.NamingService"
    <attribute name="Port">1097</attribute>

4. Add JARS to JBoss:
    a. Copy cloudscape.jar, cloudutil.jar,  cloudclient.jar, RmiJdbc.jar to $JBOSS_HOME/server/default/lib

         cp $J2EE_HOME/lib/system/cloudscape.jar $JBOSS_HOME/server/default/lib
    cp $J2EE_HOME/lib/system/cloudutil.jar $JBOSS_HOME/server/default/lib
         cp $J2EE_HOME/lib/cloudscape/cloudclient.jar $JBOSS_HOME/server/default/lib
    cp $J2EE_HOME/lib/cloudscape/RmiJdbc.jar $JBOSS_HOME/server/default/lib

5. Copy petstore application to deploy directory:

    cp $PETSTORE/src/petstore/build/petstore.ear $JBOSS_HOME/server/default/deploy

VI. Start Cloudscape Database

1. Start up cloudscape database in a separate terminal window:

    $J2EE_HOME/bin/cloudscape -start

VII. Start JBoss

1. In a separate terminal window, change directory to $JBOSS_HOME/bin

    cd $JBOSS_HOME/bin

2. Start JBoss

    sh run.sh

VIII. Run the Pet Store Application

1. Point your browser to http://localhost:8080/estore to start the pet store.