Development
From Informatics
These notes detail how to configure a development environment for having caGrid Services called from geWorkbench.
Contents |
Check List
Follow the Windows portion of the CaGrid_1.1-final wiki page.
After following the procedures on the Infrastructure Installer page, your environment should contain the following: (Note the direct paths listed are for reference only. The location you have chosen for your personal paths may differ.)
- An installed JDK1.5.
- The following Environment Variables set to appropriate locations:
ANT_HOME GLOBUS_LOCATION CATALINA_HOME
- A caGrid folder c:\java\apps\cagrid_1.1
- An Ant folder C:\java\apps\cagrid_1.1\apache-ant-1.6.5
- A Globus folder C:\java\apps\cagrid_1.1\ws-core-4.0.3
- A Tomcat server with Shutdown Port 8005 and an HTTP Port of 8080
- A $CATALINA_HOME/webapps/wsrf/WEB-INF/web.xml file with appropriate settings in it. Refer to.
- A $CATALINA_HOME/webapps/wsrf/WEB-INF/etc/globus_wsrf_core/server-config.wsdd file with appropriate settings in it. Refer to.
(Note: If the workstation IP address changes, the server-config.wsdd file will need to be updated.)
Two Eclipse Workspaces
Following the geWorkbench Eclipse Setup wiki page, create two different Eclipse workspaces. One workspace is to be used for geWorkbench components, and the other to be used for caGrid service components:
The first Eclipse workspace is for geWorkbench components. This code can be checked out using Eclipse's CVS from the location:
cbiocvs2.nci.nih.gov:/share/content/gforge/geworkbench
and put into a folder\workspace such as:
C:\java\eclipse_geworkbench_workspace
geWorkbench Eclipse Workspace
As an example, along with the standard geWorkbench Eclipse Setup
the geWorkbench component called Aracne is checked out for use with the Aracne caGrid service.
caGrid Eclipse Workspace
The second workspace is for caGrid components. This code can be checked out using Eclipse's CVS from the location:
adcvs.cu-genome.org:/cvs/magnet
and put into a folder\workspace such as: C:\java\eclipse_cagrid_workspace
Aracne Check Out from CVS
For demonstration purposes, it is shown where to get the cagrid\cagrid_1_1\Aracne service from. Check out cagrid\cagrid_1_1\Aracne to your caGrid workspace.
Dispatcher Check Out from CVS
The Dispatcher service must be checked out from cagrid\cagrid_1_1\Dispatcher to your caGrid workspace.
Ginkgo Check Out from CVS
Ginkgo is not a grid service but a utility project used when running build-server.xml while building and deploying services and stubs.
caGrid Environment setup
After checking out the above projects from CVS, their Java Build Path settings may need to be reset. Depending on individual configurations, certain jar files may not be where the projects expect them to be. If compile errors are seen, modify the entries in your “Libraries” Tab under “Java Build Path”.
If compile errors still exist after updating the Libraries Tab, they may be due to stubs that will be built in the next step, so it is not necessary to resolve all compile errors at this point. If necessary after running build-server.xml, which will create files that may be missing, a refresh maybe be performed on the projects in the caGrid workspace bringing missing files into focus.
Tomcat Config Files
As prescribed in the Production Setup wiki page
Before deploying services to Tomcat, copy the following into $CATALINA_HOME/bin:
- Dispatcher/metadata/ehcache.xml
This file contains Cache settings.
- ginkgo/metadata/dispatcher.properties
This file contains a list of services for the Dispatcher
Build and deploy caGrid Services using build-server.xml
At a DOS prompt, CD to the ginkgo directory:
cd c:\java\eclipse_cagrid_workspace\ginkgo
In this folder, build and deploy services, the dispatcher and the defaultIndexService by executing the following at the above DOS prompt:
ant –f build-server.xml
More details about build-server.xml can be found at
Bind caGrid Eclipse to a Tomcat Server
In order to be able to be able to debug caGrid services in Eclipse, the Tomcat that will be running the services should be started from MyEclipse withing the caGrid Eclipse environment.
This can be done by making use of the MyEclipse Server Icon on the MyEclipse tool bar.
Click on the Server Icon and then on “Configure Server”
Next, copy the path of the Tomcat server,
Example: C:\java\apps\cagrid_1.1\jakarta-tomcat-5.0.28
into the “Tomcat home directory:” text box. The Tomcat base directory, Tomcat temp directory Text Boxes will automatically populate once the home directory box has been populated.
Set the Tomcat Servers JDK to point to a 1.5 JDK and configure extra memory, as needed, to the VM arguments.
Example: -Xmx800M
Make the Server Launch mode to be Debug or Run as needed.
Start the Tomcat Server from the MyEclipse Server Icon
Preliminary caGrid Service Test
Test to see if the caGrid services are running by placing the following URLs in a browser:
http://localhost:8080/wsrf/services/DefaultIndexService http://localhost:8080/wsrf/services/cagrid/Dispatcher http://localhost:8080/wsrf/services/cagrid/Aracne
Run geWorkbench Component
Set Index Service URL
geWorkbench components need to be pointed to the caGrid components that have been set up. In order to test a caGrid component with geWorkbench, start Tomcat in the caGrid version of Eclipse as above and do the following in the geWorkbench application:
- Load a workspace into geWorkbench.
- In the Services Tab of the Analysis Window, choose the Grid radio button
- Click on the “Change Index Service” link and change this URL to point to the default index server deployed on your Tomcat server, http://localhost:8080/wsrf/services/DefaultIndexService
Set Dispatcher Service URL
- Click on the 'Change Dispatcher' link and change this URL to point to the Dispatcher deployed on your Tomcat server:
http://localhost:8080/wsrf/services/cagrid/Dispatcher
Select a Grid Service
- Click on the 'Grid Services' Button and observer that the caGrid services that you have created show up in this panel.
- Choose the desired service by clicking on the appropriate radio button.
Run Component
To run the configured service:
- Click on the Parameters tab of the Analysis Window
- To run the service, click on the Analyze button
Supply Username and Password
When running the service, you may be challenged with an authentication window. The username and password information for this window can be found in the userInfo.txt file that was copied to
%CATALINA_HOME%\temp\Dispatcher\
as per the Dispatcher_Aware wiki page:
Observer Results
Click on the Display button and see the results of your caGrid service
Undeploy Services
To undeploy caGrid services from Tomcat, follow the instructions the section How do I undeploy a service? in the CaGrid:FAQ wiki page.