IBM WebSphere eXtreme Scale

WebSphere eXtreme Scale REST Data Service Eclipse Project readme

In addition to the script-based getting started sandbox described in the WebSphere eXtreme Scale REST Data Service Getting Started Sample readme, a basic Eclipse project is included to get you started on your own eXtreme Scale REST data service development activities.

After the eclipse project is imported, the scripts that are included in the root of the install_root/restservice/gettingstarted directory automatically pick up any class file changes that are made.

Four different source directories are included with the project. Each source directory builds its classes in an independent /bin directory.

Directories Description
/client Includes the source files needed to connect to the grid with a traditional eXtreme Scale EntityManager client. The NorthwindOGClient.java source file includes all of the source code that is required to connect to the server. The client depends on the restclient source directory for the ObjectGrid client override XML configuration files and the common source directory for the entity classes.
/server Includes the NorthwindOGServer.java source file that demonstrates how to start a catalog service and container server programmatically in a single process. The NorthwindOGLocal.java source file shows how to create an in-memory, ObjectGrid instance that you can use to validate a configuration and entity model. The server depends on the common source directory for the entity classes.
/restclient Includes the configuration files and ObjectGrid client override files that are required by the eXtreme Scale REST data service to talk to the eXtreme Scale grid. The restclient directory depends on the common source directory for the entity classes and the server source directory for access to helper methods in the NorthwindOGLocal class.
/common Includes the entity classes that are required by the clients and servers.

Table of contents

Getting started with Eclipse

The provided project has been tested with Eclipse Version 3.x and later, and only requires the standard Java development project perspective. The following steps guide you through the setup of your eXtreme Scale development environment.

  1. Open Eclipse to a new or existing workspace.
  2. Click File > Import...
  3. Expand the General folder, select Existing Projects into Workspace, and click Next.
  4. In the select root directory field, type or browse to the install_root/restservice/gettingstarted directory. Click Finish.

    Substitute install_root with the path to the eXtreme Scale installation root directory or the root file path of the extracted eXtreme Scale trial.

    After completing these steps, you should now see the 'WXSRestGettingStarted' project in your workspace. You must resolve some build errors by defining the eXtreme Scale user library, as described in the following steps:

  5. Click File > Window > Preferences...
  6. Expand the Java-> Build Path branch and select User Libraries.
  7. Click New...
  8. Type eXtremeScale in the User Library Name field and click OK.
  9. Select the new user library and click Add JARs...

    a) Browse and select the objectgrid.jar and cglib.jar files from the install_root/lib directory. Click OK. Substitute install_root with the path to the eXtreme Scale installation root directory or the root file path of the extracted eXtreme Scale trial.

    b) To include Javadoc for the ObjectGrid APIs, select Javadoc location for the objectgrid.jar file that you added in the previous step and click Edit.

    c) In the Javadoc location path box, type the following URL:http://www.ibm.com/developerworks/wikis/extremescale/docs/api/

    Note:The ObjectGrid API documentation archive can also be downloaded from: http://www.ibm.com/developerworks/wikis/x/OgWoBg

    The correct classes and libraries are now in the build path, and the project should be error free. You can review and experiment with the source code.

Running a server with Eclipse

Complete the following steps to run the NorthwindOGServer in Eclipse, which starts the NorthwindGrid eXtreme Scale server. This process is equivalent to running the runcat.sh|bat and runcontainer.sh|bat scripts that are in the root of this project. The catalog service and one container are started in the process.

Note:If you ran the server from the command line, stop the server to avoid port conflicts.

  1. From the Run menu:

    In Eclipse 3.0 - 3.3, select Open Run Dialog...

    In Eclipse 3.4 or later, select Run Configurations...

  2. Right-click Java Application and select New...
  3. Select the new run configuration, named New_Configuration.
  4. On the Main tab, specify the name of the project and the main class:

    Project:WXSRestGettingtarted

    Main class: com.ibm.websphere.sample.xs.northwind.NorthwindOGServer

  5. On the Arguments tab, specify the VM arguments as follows:

    -Djava.endorsed.dirs=install_root/lib/endorsed

    Substitute install_root with the path to the eXtreme Scale installation root directory or the root file path of the extracted eXtreme Scale trial.

  6. Click Apply and close the window or click Run to start the catalog service and container process for the NorthwindGrid.

    When the client has completed inserting the new Customer entity into the grid, the following message is displayed: SUCCESS: Persisted Customer with name RoadRunner and key ACME

  7. After the server is up and running, you can start the REST data service.

    For details on starting the service, see Chapter 3 of the WebSphere eXtreme Scale REST data service User Guide.

Tips

The previous configuration always inserts a Customer entity with the id: ACME. You can change the program arguments in the run profile to run different operations with different values. The details of the operations and parameters are in the WebSphere eXtreme Scale REST Data Service Getting Started Sample readme.

Ensure that you substitute the correct path to the location where eXtreme Scale is installed or where the trial was extracted (two levels up from the location of this readme file). The previous steps express this location as install_root.

Troubleshooting

Object Request Broker (ORB) issues are a common setup problem. You might see the following error or a similar error: Caused by: java.lang.RuntimeException: The ORB that comes with the Sun Java implementation does not work with ObjectGrid at this time. Use the IBM ORB until the Sun ORB works. If this error occurs, check the value provided in the VM Arguments field of the run configuration. The path to java.endorsed.dirs must be an absolute path with no variables or shortcuts. Note: A known issue exists with this configuration on the Mac OSX version of Java Version 1.5. Use Java Version 1.6 to avoid any problems.

More information

Use the following links for additional information about WebSphere eXtreme Scale: Use the following links for additional about Microsoft ADO.NET Data Services: