CaGrid 1.0-beta

From Informatics

Jump to: navigation, search

See Also: caBIG caGrid Wiki

currently using the beta release

Contents

Getting Started

Building caGrid

ant -f share\globus_wsrf_common\tomcat\tomcat.xml deployTomcat -Dtomcat.dir="%CATALINA_HOME%"

This deploys globus into tomcat. The verbose (to see what directories globus affects in tomcat ... note the /common directory) is:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\keshav>cd %GLOBUS_LOCATION%
C:\java\apps\ws-core-4.0.2>ant -f share\globus_wsrf_common\tomcat\tomcat.xml deployTomcat -Dtomcat.dir="%CATALINA_HOME%"
Buildfile: share\globus_wsrf_common\tomcat\tomcat.xml
deployTomcat:
_baseTomcatDeploy:
   [mkdir] Created dir: C:\java\apps\apache-tomcat-5.5.17\webapps\wsrf
    [copy] Copying 90 files to C:\java\apps\apache-tomcat-5.5.17\webapps\wsrf
   [mkdir] Created dir: C:\java\apps\apache-tomcat-5.5.17\webapps\wsrf\WEB-INF
    [copy] Copying 30 files to C:\java\apps\apache-tomcat-5.5.17\webapps\wsrf\WEB-INF
   [mkdir] Created dir: C:\java\apps\apache-tomcat-5.5.17\webapps\wsrf\WEB-INF\classes
    [copy] Copying 1 file to C:\java\apps\apache-tomcat-5.5.17\webapps\wsrf\WEB-INF\classes
    [copy] Copying 1 file to C:\java\apps\apache-tomcat-5.5.17\webapps\wsrf\WEB-INF\classes
   [mkdir] Created dir: C:\java\apps\apache-tomcat-5.5.17\webapps\wsrf\WEB-INF\lib
    [copy] Copying 1 file to C:\java\apps\apache-tomcat-5.5.17\webapps\wsrf\WEB-INF
    [copy] Copying 1 file to C:\java\apps\apache-tomcat-5.5.17\common\endorsed
    [copy] Copying 58 files to C:\java\apps\apache-tomcat-5.5.17\webapps\wsrf\WEB-INF\lib
BUILD SUCCESSFUL
Total time: 5 seconds
C:\java\apps\ws-core-4.0.2>

Get Security Certificate

You will need this to create services as the service creation tool connects to the caDSR (among other things), which looks for valid credentials.

  • cd into caGrid-1.0-dorian.
  • run ant portal.
  • click on Identity Provider and Register User. Fill out the form and submit.

Configure and Deploy Index Service

  • Before you do this, make sure you have executed the steps in Building caGrid.
  • cd to caGrid-1.0-index and run ant (the default target is deployIndexTomcat. This should deploy the IndexService. (This can also be run as an eclipse ant configuration from within eclipse).
  • To invoke the IndexService, you can use the DiscoveryClient.java in caGrid-1.0-discovery or extend this and create your own client. Make sure, however you have the file client-config.wsdd in the same directory where the JVM will execute. This, for instance should be in the caGrid-1.0-discovery (you can get this from the caGrid-1.0-beta-core project).
  • When invoking the index service, if you see "No services available", check the registration.xml file of your service and make sure the '<wsa:Address>' is set to 'http://localhost:8080/wsrf/services/DefaultIndexService'.
  • Set the commons-logging message priority level to DEBUG as described in CaGrid_Debugging.
  • If you see an error stating that properties cannot found at https://xxx:8443/wsrf/services/YourService when trying to invoke the index service, see here (I have chosen option 4): http://gforge.nci.nih.gov/plugins/wiki/index.php?BetaReleaseKnownIssues&id=25&type=g. That is, make sure you add the following to $CATALINA_HOME/webapps/wsrf/WEB-INF/web.xml:
<servlet>
   <servlet-name>WSRFServlet</servlet-name>
   <display-name>WSRF Container Servlet</display-name>
   <servlet-class>
       org.globus.wsrf.container.AxisServlet
   </servlet-class>
   <init-param>
           <param-name>defaultProtocol</param-name>
           <param-value>http</param-value>
       </init-param>
       <init-param>
           <param-name>defaultPort</param-name>
           <param-value>8080</param-value>
   </init-param>	
   <load-on-startup>true</load-on-startup>
 </servlet>

Setup in Eclipse

  • If you have not already done so, make sure you cd into the caGrid directory and run ant all (as indicated above).
  • In eclipse, click File->Import, find the caGrid directory and select all the projects.
  • Define the following classpath variables in eclipse. That is,
    • Window->Preferences
    • Java->Build Path->Classpath Variables

Now define: ANT_HOME and GT4_LOCATION

Creating a Service

  • Before you do this, make sure you have executed the steps above.
  • Setup introduce.
  • After this has been setup, start introduce and create your service using the GUI.
  • Add the Service Extension caGrid Metadata.
  • To configure logging in your services, see caGrid Debugging.
  • For more information on caGrid data types, see caGrid Datatypes.

Deploying Services

  • Before you do this, make sure you have executed the steps under Building caGrid.

See also: caGrid Debugging.

Deploying Reference and Sample Services

To deploy the Sample1Service, create an eclipse Ant configuration for the Sample 1 Service with the target all, and another with the target tomcatDeploy. Run them both.

You can test that the service is running either via the browser or with the generated service client. In both cases, the url to use is http://localhost:8080/wsrf/services/cagrid/SampleService1.

Deploying Our Own Services

Use the deploy functionality of the Introduce toolkit. You can test your service from the browser by typing something like http://localhost:8080/wsrf/services/cagrid/MyService (default). Alternatively, you can invoke it from the generated client stub.

Deploying Multiple Services in Tomcat

There is a class loading issue when deploying multiple service to a single tomcat instance. The root of the problem is globus related, and is documented in detail here.

The suggested workaround is to run each service in a separate globus container. A step-by-step procedure on the configuration steps required is documented here.

Globus (wsrf)

This will be moved to a globus page

To see what web services you get from globus, run (make sure tomcat is not running, or at least not running on the same port)

C:\java\apps\ws-core-4.0.2>bin\globus-start-container -nosec

This gives me:

C:\java\apps\ws-core-4.0.2>bin\globus-start-container -nosec
Starting SOAP server at: http://156.145.29.64:8080/wsrf/services/
With the following services:
[1]: http://156.145.29.64:8080/wsrf/services/SampleAuthzService
[2]: http://156.145.29.64:8080/wsrf/services/Version
[3]: http://156.145.29.64:8080/wsrf/services/NotificationConsumerService
[4]: http://156.145.29.64:8080/wsrf/services/NotificationTestService
[5]: http://156.145.29.64:8080/wsrf/services/SecureCounterService
[6]: http://156.145.29.64:8080/wsrf/services/AuthzCalloutTestService
[7]: http://156.145.29.64:8080/wsrf/services/WidgetNotificationService
[8]: http://156.145.29.64:8080/wsrf/services/PersistenceTestSubscriptionManager
[9]: http://156.145.29.64:8080/wsrf/services/AdminService
[10]: http://156.145.29.64:8080/wsrf/services/ShutdownService
[11]: http://156.145.29.64:8080/wsrf/services/ContainerRegistryService
[12]: http://156.145.29.64:8080/wsrf/services/gsi/AuthenticationService
[13]: http://156.145.29.64:8080/wsrf/services/TestRPCService
[14]: http://156.145.29.64:8080/wsrf/services/CounterService
[15]: http://156.145.29.64:8080/wsrf/services/TestService
[16]: http://156.145.29.64:8080/wsrf/services/TestAuthzService
[17]: http://156.145.29.64:8080/wsrf/services/SecurityTestService
[18]: http://156.145.29.64:8080/wsrf/services/ContainerRegistryEntryService
[19]: http://156.145.29.64:8080/wsrf/services/NotificationConsumerFactoryService
[20]: http://156.145.29.64:8080/wsrf/services/SubscriptionManagerService
[21]: http://156.145.29.64:8080/wsrf/services/ManagementService
[22]: http://156.145.29.64:8080/wsrf/services/TestServiceWrongWSDL
[23]: http://156.145.29.64:8080/wsrf/services/WidgetService
[24]: http://156.145.29.64:8080/wsrf/services/TestServiceRequest


Introduce

  • In eclipse click Run->External Tools->External Tools.
  • Click on Ant Build and click New.
  • Under Buildfile click on Browse Workspace and select the project caGrid-1.0-beta-introduce. Select the build.xml file.
  • Under Base Directory click on Browse Workspace and select the project caGrid-1.0-beta-introduce.
  • Under the Targets tab make sure the only selected target is introduce.
  • Click Apply.
  • Click Run.
Personal tools