Deploying to WebSphere Application Server

Create the restcfgdir environment variable

  1. Open the WebSphere Application Server administrative console. The console is typically found at: https://<hostname:port>/ibm/console/logon.jsp.
  2. Select Servers > (Expand Server Types)> WebSphere application servers > <server_name> > (Expand Java and Process Management) > Process Definition > Environment Entries > New
  3. Add entries to the Name/Value pairs.
    1. Name: Must be restcfgdir
    2. Value: Full path to the directory that was specified for the ODRESTAdmin setup command
    3. Description: Optional
  4. Click OK.
  5. Save changes to the master configuration and restart the web application server.

Create the shared library

  1. Open the WebSphere Application Server administrative console.
  2. Select Environment > Shared Libraries > New
  3. Add an entry for CMODRestSharedLibrary.
    1. Name: Example: CMODRestSharedLib
    2. Description: Optional
    3. Classpath: The full path to the five required shared libraries. Examples are given for the Windows platform.
      Content Manager OnDemand Web Enablement Kit Java API
      c:/Program Files/IBM/OnDemand/V10.5/www/api/ODApi.jar
      gson
      c:/Program Files/IBM/OnDemand/V10.5/jars/gson-<version>.jar
      log4j-api
      c:/Program Files/IBM/OnDemand/V10.5/jars/log4j-api-<version>.jar
      log4j-core
      c:/Program Files/IBM/OnDemand/V10.5/jars/log4j-core-<version>.jar
      commons-pool2
      c:/Program Files/IBM/OnDemand/V10.5/jars/commons-pool2-<version>.jar

    The paths referenced in the example assume a default Content Manager OnDemand installation. Your paths might be different.

    When specifying the version for gson, commons-pool, and log4j, ensure that the version matches the version that is installed with Content Manager OnDemand. Newer versions might be installed with a Content Manager OnDemand upgrade.
  4. Click OK.
  5. Save changes to the master configuration.
  6. Select Application Servers > <server_name> > (Expand Java and Process Management) > ClassLoader. Click New to add a classloader with "PARENT_FIRST"
  7. Click OK.
  8. Select the class loader created in step 6 > Shared Libraries > Add.
  9. Add the shared library created above. Click OK.
  10. Save changes to the master configuration and restart the application server.

Deploying the war file

With WebSphere Application Server configured, the cmod-rest.war file can be deployed.

  1. Select Applications > New Application > New Enterprise Application
  2. Click Browse… and navigate to the location of the cmod-rest.war file. The default locations are listed in Deploying REST Services to an application server. Click Next.
  3. Select Fast Path radio button. Click Next.
  4. Installation options can be left as default. Click Next.
  5. On Map modules to servers, click Next.
  6. On Map virtual hosts for Web modules, click Next.
  7. On Map context roots for Web modules, enter the desired Context Root, such as: /cmod-rest.

    Click Next.

  8. On Metadata for modules, click Next.
  9. On Summary, click Finish.
  10. Save changes to the master configuration and restart the web application server.

Content Manager OnDemand REST Services should now be deployed and running on WebSphere Application Server. Refer to the application server logs for information about REST Services startup. All information, including connection pool initialization, is logged there. In addition, REST Services also logs information to the file named arsrestapi.log. For a default installation, this file can be found in <WAS install dir>/AppServer/profiles/AppSrv01/logs.