Deploying the REST data service on Apache Tomcat

This topic describes how to configure the WebSphere eXtreme Scale REST data service on Apache Tomcat Version 5.5 or later.

About this task

Procedure

  1. If using a Sun JRE or JDK, install the IBM ORB into Tomcat:
    1. Tomcat version 5.5:

      Copy all of the JAR files from:

      /lib/endorsed

      to:

      /common/endorsed

    2. Tomcat version 6.0:

      Create an "endorsed" directory:

      [Unix][Linux] mkdir /endorsed

      [Windows] md /endorsed

  2. Configure and start an eXtreme Scale grid.
    1. For details on configuring an eXtreme Scale grid for use with the REST data service, see the topic.
    2. Verify that an eXtreme Scale client can connect to and access entities in the grid. For an example, see the Getting Started section of this document.
  3. Build the eXtreme Scale REST service configuration JAR or directory. See the topic for details.
  4. Deploy the REST data service module: wxsrestservice.war to the Tomcat server.

    Copy the wxsrestservice.war file from:

    /lib

    to:

    /webapps

  5. Add the ObjectGrid client runtime JAR and the application JAR to the shared classpath in Tomcat:
    1. Edit the /conf/catalina.properties file
    2. Append the following path names to the end of the shared.loader property separating each with a comma:
      • /lib/ogclient.jar
      • /gettingstarted/restclient/bin
      • /gettingstarted/common/bin
  6. If using Java 2 security, add security permissions to the tomcat policy file:
    • If using Tomcat version 5.5:

      Merge the contents of the sample 5.5 catalina policy file found in

      /restservice/gettingstarted/tomcat/catalina-5_5.policy

      with the

      /conf/catalina.policy

      file.

    • If using Tomcat version 6.0:

      Merge the contents of the sample 6.0 catalina policy file found in

      restservice/gettingstarted/tomcat/catalina-6_0.policy

      with the

      /conf/catalina.policy

      file.

  7. Start the Tomcat server:

    If using Tomcat 5.5 on UNIX or Windows, or the Tomcat 6.0 ZIP distribution:

    1. cd /bin
    2. Start the server:
      • Without Java 2 security enabled:

        [Unix][Linux] ./catalina.sh run

        [Windows] catalina.bat run

      • With Java 2 security enabled:

        [Unix][Linux] ./catalina.sh run -security

        [Windows] catalina.bat run -security

    3. The Apache Tomcat logs are displayed to the console. When the REST data service has started successfully, the following message is displayed in the administration console:

      CWOBJ4000I: The WebSphere eXtreme Scale REST data service has been started.

    If using Tomcat 6.0 on Windows using the Windows installer distribution:
    1. cd /bin
    2. Start the Apache Tomcat 6 configuration tool:

      tomcat6w.exe

    3. To enable Java 2 security (optional):

      Add the following entries to the Java Options in the Java tab in the Apache Tomcat 6 properties window:

      -Djava.security.manager

      -Djava.security.policy=\conf\catalina.policy

    4. Click on the Start button on the Apache Tomcat 6 properties window to start the Tomcat server.
    5. Review the following logs to verify that the Tomcat server has started successfully:
      • /bin/catalina.log

        Displays the status of the Tomcat server engine

      • /bin/stdout.log

        Displays the system output log

    6. When the REST data service has started successfully, the following message is displayed in the system output log:

      CWOBJ4000I: The WebSphere eXtreme Scale REST data service has been started.

    7. Verify the REST data service is working:

      Open a Web browser and navigate to the following URL:

      http://<host>:<port>/<context root>/restservice/<Grid Name>

      The default port for Tomcat is 8080 and is configured in the /conf/server.xml file in the <Connector> element.

      For example:

      http://localhost:8080/wxsrestservice/restservice/NorthwindGrid/

      Result: The AtomPub service document is displayed.