[Java programming language only]

Running a WebSphere eXtreme Scale application that uses an application server other than WebSphere Application Server in Eclipse

You can configure a Java™ EE application that uses WebSphere® eXtreme Scale to run in an application server other than WebSphere Application Server in Eclipse.

Before you begin

  • Install the stand-alone version of the WebSphere eXtreme Scale product, or download and extract the WebSphere eXtreme Scale trial version. For more information, see Installing.
  • Install an application server, such as Apache Tomcat Version 6.0 or later.
  • Install Eclipse and create a Java EE web application. The Java EE perspective is required and must be installed in your Eclipse environment.
  • Download the API documentation. For more information, see IBM Elastic Caching Community wiki: API documentation downloads.

About this task

The following procedure was tested with Apache Tomcat and JBoss Application Server. The instructions also apply to other application servers.

Procedure

  1. Add WebSphere eXtreme Scale runtime library to your Java EE build path.
    The steps vary slightly if you are using a full installation of WebSphere eXtreme Scale or an installation of .

    WebSphere eXtreme Scale Client

    Use the following steps if you have only WebSphere eXtreme Scale Client installed:

    1. Window > Preferences > Java > Build Path > User Libraries. Click New.
    2. Enter a User library name of eXtremeScaleClient, and click OK.
    3. Click Add Jars..., and select the wxs_home/lib/ogclient.jar file. Click Open.
    4. Optional: To add Javadoc, select Javadoc location and click Edit....
      Enter your local download location.
    5. Click OK.
    6. Click OK to close out the User Libraries dialog.
    7. Click Project > Properties.
    8. Click Java Build Path.
    9. Click Add Library.
    10. Select User Library. Click Next.
    11. Check the eXtremeScaleClient library and click Finish.
    12. Click OK to close the Project Properties dialog.

    Full WebSphere eXtreme Scale installation

    Use the following steps if you used the full installation to install a client and server:

    1. Click Window > Preferences > Java > Build Path > User Libraries. Click New.
    2. Enter a User library name of eXtremeScale, and click OK.
    3. Click Add Jars..., and select wxs_home/lib/objectgrid.jar. Click Open.
    4. (Optional) To add Javadoc, select Javadoc location and click Edit.... Enter your local download location.
    5. Click OK.
    6. Click OK to close out the User Libraries dialog.
    7. Click Project > Properties.
    8. Click Java Build Path.
    9. Click Add Library.
    10. Select User Library. Click Next.
    11. Check the eXtremeScaleClient library and click Finish.
    12. Click OK to close the Project Properties dialog.
  2. Add Java EE application projects to the server.
    1. Ensure that you are in the Java EE perspective and click the Servers tab in the bottom pane. You can also click Window > Show View > Servers.
    2. Right-click in the Servers pane, and choose New > Server.
    3. Choose your application server. Click Next.
    4. Click Browse... Select the root directory of your application server. Click OK.
    5. Click Next.
    6. Select your Java EE application project in the left Available pane and click Add > to move it to the right Configured pane on the server, and click Finish.
  3. Resolve any remaining errors for the Project.
    Use the following steps to eliminate errors in the Problems pane:
    1. Click Project > Clean > project_name. Click OK. Build the project.
    2. Right-click on the Java EE project, and choose Build Path > Configure Build Path.
    3. Click the Libraries tab.
      Ensure that Apache Tomcat or your other application server, eXtremeScaleClient, and JRE are on the path.
  4. Create a run configuration to run your application.
    1. From the Run menu, select Run Configurations.
    2. Right-click the Java Application category and select New.
    3. Select the new run configuration, named New_Configuration.
    4. Configure the profile.
      • Project (on main tabbed page): your_project_name
      • Main Class (on main tabbed page): your_main_class
      • VM arguments (on arguments tabbed page): -Djava.endorsed.dirs=wxs_home/lib/endorsed

      Problems with the VM arguments often occur because the path to the java.endorsed.dirs directory must be an absolute path with no variables or shortcuts.

      Other common setup problems involve the Object Request Broker (ORB). You might see the following error:
      Caused by: java.lang.RuntimeException: The ORB that comes with the 
      Java implementation does not work with ObjectGrid at this time.
      For more information, see Configuring a custom Object Request Broker.
      If you do not have the objectGrid.xml or deployment.xml files accessible to the application, you might see the following error:
      Exception in thread "P=211046:O=0:CT" com.ibm.websphere.objectgrid.ObjectGridRuntimeException: 
      Cannot start OG container
      	at Client.startTestServer(Client.java:161)
      	at Client.main(Client.java:82)
      Caused by: java.lang.IllegalArgumentException: The objectGridXML must not be null
      	at com.ibm.websphere.objectgrid.deployment.DeploymentPolicyFactory.createDeploymentPolicy
        (DeploymentPolicyFactory.java:55)
      	at Client.startTestServer(Client.java:154)
      	... 1 more
  5. Click Apply and close the window, or click Run.

Results

You can now run your Java EE application that uses WebSphere eXtreme Scale in Eclipse.