Home
Develop WXS v8.6 applications
Develop Java applications
We can develop Java applications to access and insert data in the data grid. Use plug-ins to develop specific functions for pluggable components. Your applications can also integrate with other frameworks, including OSGi, JPA, and Spring.
- Access data
- System APIs and plug-ins
- OSGi integration
- JPA integration
- Spring integration
Set up the Java development environment
Set up a stand-alone development environment in Eclipse
Configure an Eclipse-based integrated development environment to build and run a Java SE application with the stand-alone version of WXS.
Before you begin install the WXS product into a new or empty directory and apply the latest WXS cumulative fix pack. We can also use the WXS trial version by unzipping the zip file.
- Configure Eclipse to build and run a Java SE application with WXS.
- Define a user library to allow the application to reference WXS application programming interfaces.
- In your Eclipse or IBM RAD environment, click...
Window | Preferences | Java | Build Path branch | User Libraries | New
- Select the eXtreme Scale user library. Click Add JARs.
- Browse and select the objectgrid.jar or ogclient.jar files from the wxs_root/lib directory. Click OK. Select the ogclient.jar file if we are developing client applications or local, in-memory caches. If we are developing and testing eXtreme Scale servers, use the objectgrid.jar file.
- To include Javadoc for the ObjectGrid APIs, select the Javadoc location for the objectgrid.jar or ogclient.jar file that you added in the previous step. Click Edit. In the Javadoc location path box, type the following web address:
http://www.ibm.com/developerworks/wikis/extremescale/docs/api/
- Click OK to apply the settings and close the Preferences window.
The eXtreme Scale libraries are now in the build path for the project.
- Add the user library to your Java project.
- From the package explorer, right-click the project and select Properties.
- Select the Libraries tab.
- Click Add Library.
- Select User Library. Click Next.
- Select the eXtreme Scale user library that you configured earlier.
- Click OK to apply the changes and close the Properties window.
- Run a Java SE application with WXS with Eclipse. Create a run configuration to execute the application.
- Configure Eclipse to build and run a Java SE application with WXS. From the Run menu select Run Configurations.
- Right-click the Java Application category and select New.
- Select the new run configuration, named New_Configuration.
- 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_root/lib/endorsed
Problems with the VM Arguments often occur because the path to java.endorsed.dirs 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