Installing Examples


System Requirements

1. Unzip examples.zip file

ex) unzip c:\examples.zip
Examples directory will be created.

2. Learn about the directory structure of the examples

Some part of the examples provides a fancy JSP GUI to launch the client-side programs. You need to set up Tomcat for the examples. Regarding the examples that do not provide JSP, please follow the instruction in each chapter and the document in the docs directory.

+ examples
  + bin Batch files to run the programs
  + docs Documents for each chapter
  + ear EAR file for EJB and JMS examples of chapter 5
  + src Source code for the examples
  + webapps
    + bws WAR for the examples
      + WEB-INF
        + web.xml
        + lib
The library files(JAR) required for the examples. You may want to add additional jar files into this directory for some examples.

        + <others>
The Web contents (HTML, XML, and JSP) for the examples.

3. Install Tomcat

  1. Download Tomcat 3.2.4 binary package from http://jakarta.apache.org/.
  2. Extract the Tomcat binary package.

    ex) unzip c:\jakarta-tomcat-3.2.4.zip
    jakarta-tomcat-3.2.4 directory will be created.

4. Setup Tomcat

  1. Copy examples\webapps\bws directory into <jakarta-tomcat>\webapps\ directory.
  2. Add the following entry to the appropriate place in <jakarta-tomcat>\conf\server.xml.

    <Context
      path="/bws"
      docBase="webapps/bws"
      crossContext="false"
      debug="0"
      reloadable="true" >
    </Context>

  3. *OPTIONAL* If you run the examples of ch5 ex1-ex3(i.e, BASIC-AUTH and SSL), you need to add the following entry to the appropriate place in <jakarta-tomcat>\conf\server.xml.

    <Connector
      className="org.apache.tomcat.service.PoolTcpConnector">
      <Parameter name="handler"
        value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
      <Parameter name="port" value="8443"/>
      <Parameter name="socketFactory"
        value="org.apache.tomcat.net.SSLSocketFactory" />
      <Parameter name="keystore"
        value="webapps\bws\SkatesTown.ks"/>
      <Parameter name="keypass" value="wsbookexample"/>
      <Parameter name="clientAuth" value="false"/>
    </Connector>

    You also need to add the following entry to the appropriate place in <jakarta-tomcat>\conf\tomcat-users.xml.

    <user
      name="SkateboardWarehouse"
      password="wsbookexample"
      roles="MyCustomer"/>

    Then, add the JSSE jar files (i.e, jsse.jar, jnet.jar, and jcert.jar) into examples\webapps\bws\WEB-INF\lib\ directory.

  4. Set the environment variable JAVA_HOME and TOMCAT_HOME

    ex) set JAVA_HOME=c:\jdk1.3
         set TOMCAT_HOME=c:\jakarta-tomcat-3.2.4

5. Run Tomcat

  1. Change directory to examples.

    ex) cd c:\examples

  2. Run examples\bin\run-tomcat.bat

    ex) .\bin\run-tomcat.bat

6. Open the example URL

Please open the URL http://localhost:8080/bws/ and follow the instructions.


Back to the index page.