WebSphere Extended Deployment, Version 6.0.x
             Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS


Importing and using the ObjectGrid sample application in Eclipse

Use this task to import and use the ObjectGrid sample application in Eclipse.

Before you begin

[Version 6.0.1 and later] Before you begin this task, install the mixed server environment, including the standalone ObjectGrid. See Installing a remote monitor and a stand-alone ObjectGrid from WebSphere Extended Deployment in a mixed environment for more information.

For this sample application, use Eclipse Version 3.1 or later to import and run the sample. You can obtain Eclipse from the Application Server Toolkit that is included with WebSphere Application Server, from installing Rational Application Developer, or by downloading it directly from Eclipse.org.

About this task

By using Eclipse, you can easily debug your applications. You can perform a step-by-step walk through of the sample application.

Procedure

  1. Import the project into Eclipse:
    1. Run the Eclipse program. Use the eclipse.exe file in the Eclipse installation directory.
    2. Using Eclipse, create a new project.
      1. Click File > New > Project > Java > Java Project. Click Next.
      2. Type a project name. For example, type ObjectGridSamples.
      3. Select Create new project in workspace.
      4. In the Project Layout section, click Configure default.
      5. For the source and output folder, select Project and click OK.
      6. Click Next.
      7. Click the Libraries tab.
      8. Click Add External JARs.
      9. Navigate to the /ObjectGrid/lib folder and select the objectgrid.jar, asm.jar, and cglib.jar files. Click Open in the JAR selection wizard.
      10. Click Finish.
  2. Import the objectgridSamples.jar file into the Java Project.
    1. Right-click on the Java project and select Import.
    2. Select Zip file under Select an import source.
    3. Click Next.
    4. Click Browse to open the Import From Zip File wizard.
    5. Open the objectgridSamples.jar file. Navigate to the /ObjectGrid/samples directory. Select the objectgridSamples.jar file and click Open.
    6. Verify that the check box of the root file tree is selected.
    7. Verify that the Into folder contains the Java project that you created in the previous step, for example, the ObjectGridSamples project.
    8. Click Finish.
  3. Check the properties of the Java Project.
    1. Open the Java Perspective. Click Window > Open Perspective > Java.
    2. Go to the console view. Click Window > Show view > Console.
    3. Verify that the Package Explorer view is available and selected. Click Window > Show View > Package Explorer.
    4. Right-click on the Java project and select Properties.
    5. Click Java Build Path on the left panel.
    6. Click the Source tab in the right panel.
    7. Verify that the project root is listed in the Source folders on the Build path panel.
    8. Click the Libraries tab in the right panel.
    9. Verify that the objectgrid.jar, asm.jar, and cglib.jar files and a JRE System Library are listed in the JAR and class folders on the Build path panel.
    10. Click OK.
  4. Run the ObjectGrid sample.
    1. From the Package Explorer view, expand the Java project.
    2. Expand the com.ibm.websphere.samples.objectgrid.basic package.
    3. Right-click on the ObjectGridSample.java file. Click Run > Java Application.
    4. The console displays similar output to when you run the application on the Java command line. For an example of the output, see Running the ObjectGrid sample application on the command line.
  5. [Version 6.0.1 and later] Run the distributed ObjectGrid sample. To run the distributed ObjectGrid sample, you must configure an ObjectGrid cluster. For running this sample, you can use the predefined XML configuration files that are provided in the objectgridSamples.jar file. See Starting the standalone sample ObjectGrid cluster for more information.

    After the ObjectGrid server is started, you can run the distributed ObjectGrid sample application with the following steps:

    1. From the Package Explorer view, expand the Java project.
    2. Expand the com.ibm.websphere.samples.objectgrid.distributed package.
    3. Right-click on the DistributedObjectGridSample.java file. Click Run > Java Application.
    4. The console displays output that is similar to the ObjectGrid sample.

What to do next

The steps to load the project and run the debugger are also in the SamplesGuide.htm file. The SamplesGuide.htm file is in the doc directory in the objectgridSamples.jar file.



Related reference
Task topic    

Terms of Use | Feedback

Last updated: Nov 30, 2007 4:06:03 PM EST
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=/com.ibm.websphere.xd.doc/info/objectgrid/tobgeclipse.html