Table of Contents
Introduction
Here is recorded the study of caCORESDK-4.0 and the lessons learnt during the publishing of the sample model to caGrid training portal. The sample model comes with the caCORESDK-4.0 download. Security was not used and security/authentication features not enabled (disabled by default) for studying this sample model. Security is incorporated through the Common Security Module(CSM) in the caCORE SDK.
caCORESDK is a data management framework designed for researchers who need to be able to navigate through a large number of data sources. The caCORE SDK generated system is built on the principles of Model Driven Architecture (MDA), n-tier architecture & common API for data access.
The Developer's Guide (pdf attached) is the best place to start learning the SDK. The chapters of interest and which overall convey the caCORE SDK functionality are 2-Overview, 3-Code Generation Technical Overview, 4-Runtime System Technical Overview, 9-Creating the UML Model for caCORE SDK, and 10-Configuring and Running the SDK.
Getting Started
The caCORE SDK distribution provides a sample model to better understand the workings of SDK. The sample model is intended to be used as a reference when creating your own model. The sample model is located within the /models directory of the SDK distribution, and has been implemented in both Enterprise Architect and ArgoUML. The name of the sample model project file is, respectively:
- Enterprise Architect: SDKTestModel.EAP
- ArgoUML: sdk.uml
Chapter9-Configuring and Running SDK from the caCORE SDK developer's guide, gives detailed explanation of the SDK config file $CACORESDK/conf/deploy.properties and how to modify to suit our environment.
Accordingly, the changes that were made to the deploy.properties concerned setting the SERVER_TYPE to tomcat, DATABASE=mysql and the db url, name, password, and hibernate mappings for mysql.
The port number was also changed where it was referenced in the deploy.properties, because, tomcat was running on port 9080.################################################################################## # APPLICATION SERVER PROPERTIES # # SERVER_TYPE if set to jboss will exclude log4j.jar from the war file # any other value will include the log4j.jar in the war file ################################################################################## SERVER_TYPE=other SERVER_URL=http://localhost:9080/${PROJECT_NAME} ################################################################################## # DATABASE CONNECTION PROPERTIES # # If USE_JNDI_BASED_CONNECTION=yes then DB_JNDI_URL is used to obtain the # connection and get data. # If USE_JNDI_BASED_CONNECTION=no then DB_DRIVER, DB_CONNECTION_URL, DB_USERNAME # and DB_PASSWORD is used to initialize the collection and get data. # # DB_DIALECT is used by the Hibernate to prepare the database specific queries # # CACHE_PATH is being used by the EHCache to store its cache files on disk ################################################################################## USE_JNDI_BASED_CONNECTION=no DB_JNDI_URL=java:/SDK DB_CONNECTION_URL=jdbc:mysql://localhost:3306/cacoresdk?autoReconnect=true DB_USERNAME=cabiguser DB_PASSWORD=cabigpass DB_DRIVER=com.mysql.jdbc.Driver #DB_DRIVER=oracle.jdbc.driver.OracleDriver DB_DIALECT=org.hibernate.dialect.MySQLDialect #DB_DIALECT=org.hibernate.dialect.OracleDialect
Modify Deploy and Test the Sample Model
After modifying the deploy.properties, the SDK for the sample model was generated with the ant targets ant clean-all build-system. As a result, the SDK generates the artifacts/packages which are to be consumed by the caCORE runtime system. These artifacts will be placed at $CACORESDK/output/<project-name>/package/ and the different artifacts generated are:
- local-client
- remote-client
- ws-client
- webapp
Now to deploy the sample model, copy the SDK generated Web Archive (WAR) file at $CACORESDK/output/<project-name>/package/webapp to $CATALINA_HOME/webapps/ caCORE SDK provides the invaluable and useful feature of generating the test clients for a given model. The SDK generates basic skeletons with hibernate mappings from the tags provided in the sample UML/XMI model. These test clients can then be modified according to one's needs. The generated test client frameworks are:
- Web Interface
- Java API
- XML Utility
- Web Service Interface (Axis,WSDL)
- Web Service Interface via Client Program
Errors and Troubleshoot
- Testing the web interface client, which is starting tomcat, and point to the location http://localhost:9080 in a browser. Having done to this effect, got an error of a missing commons-logging.jar, ticket:82 This was due to an missing definition in the $CACORESDK/build.xml file, which was later corrected and reported to the caGrid_users mailing list.
- Upon successful deployment of the web service, encountered this:
An error relating to mysql table naming occurred when querying for an attribute from one of the domain packages of the sample model from the browser. This error related to the sensitivity of the Unix/Linux systems with respect to database namings. Unix/Linux systems differentiate the case of the table names in a database, whereas Windows systems typecast uppercase to lowercase names when querying for an attribute in the database. The sample model provided with the SDK had a mysql schema with lowercase table names and the SDK generated uppercase hibernate mappings for the same model. This was because, the SDK sample model was only tested for Windows systems. When this was reported to caCORE-SDK users mailing list, they provided a mysql schema for the sample model in uppercase. This resolved the name conflict and so was able to query the sample model's data from the browser.
The testing of the other clients, as mentioned in the dev guide, was also successful later on.
Create Deploy and Invoke the Data Service for the SDK Sample Model
The next steps are
- Target a specific grid for ultimately publishing the data service to caGrid portal. For this, we chose for testing purpose, the training grid. To do so, one should run:
ant -Dtarget.grid=training-1.2 configure
- Create a data service out of the caCORE SDK generated run time system from the sample model. During the creation of data service from Introduce, in the configuring the client step, mentioned the IP address (10.0.0.116) instead of a name in the Hostname field and the port as 9080. This was done to avoid any DN resolution conflicts when this data service is queried/searched for by the caGrid Index service.
- Deploy the data service and
- Invoke the grid service
Errors and Troubleshoot
During the creation of data service of the sample model in Introduce, got an error when converting the sample model's XMI file to domain model. When this was reported to caGrid_users list, got to know that the XMI model supplied as input to caCORE SDK and the XMI model required by Introduce are quite different, the later is specifically - Domain Model. Found that there was a caGrid utility to convert the XMI to domain model and the one which we had was not the updated one. So, checked out the latest caGrid-1.2 patch, converted the XMI to Domain model with the patched caGrid's utility and then was able to successfully create a data service with Introduce
Publishing the Sample Data Service to caGrid Training Portal
cabigbox.lab.ac.uab.edu is the target server meant for publishing the data and analytical services to caGrid's training grid. To publish the sample model's data service to cabigbox, the steps followed were:
- Copied the Introduce created data service (as a result of step2 above, Create a data service) to cabigbox src directory
- cd to ~/src/caGrid on cabigbox and run Introduce.
- Deployed the sample data service to $GLOBUS_LOCATION on cabigbox
- Restarted globus with this command
$GLOBUS_LOCATION/bin/globus-start-container -nosec -containerDesc /home/cagrid/src/ws-core-4.0.3/etc/globus_wsrf_core/global_security_descriptor.xml 2>&1 > /tmp/gs-container.out &
- Opened the training portal - http://portal.training.cagrid.org/web/guest/home
It takes nearly 30 to 60 minutes for the data service to be actually visible on the training portal, provided everything goes without a hitch. In the meantime, we can perform some checks if we had been successful or not in the publishing of our data service. These checks are:
- For a quick check, go to the training portal discovery service. Enter the URL of the data service in the Service Diagnostics section. The URL can be obtained from the globus log file. In this case, on cabigbox at /tmp/gs-container.out. The format of the URL for the sample data service looks like this in the globus log file:
http://cabigbox.lab.ac.uab.edu:8080/wsrf/services/cagrid/Example2008123102
- IndexService checks can be performed from command line.
Errors and Troubleshoot
So, having successfully passed the checks, and the sample data service visible on the training portal, queried for data.
- Initially got a connection timed out to http://10.0.0.116 error. Double-checked tomcat was indeed running, but stuck at the same problem.
- Found that the port 9080 had not been opened from 10.0.0.116 and the firewall settings were not configured on 10.0.0116 to do so. Documenting here the steps followed to open ports in firewall on opensuse 10.3:
- Stop tomcat
- Go to Yast->Security->Firewall
- Stop Firewall
- Go to Allowed Services->Advanced
- Add 9080 to TCP ports, separated by a space
- Click Ok->Next->Accept
- Restart the Firewall
- Restart tomcat
- Check for port 9080. Go to meter.lab.ac.uab.edu and do a telnet telnet 10.0.0.116 9080
- After configuring the firewall on 10.0.0.116, queried the sample data service again from caGrid training portal. This time saw this error:
faultDetail: {http://gov.nih.nci.cagrid.data/DataServiceExceptions}QueryProcessingException:2009-01-02T16:10:53.122Zhttp://cabigbox.lab.ac.uab.edu:8080/wsrf/services/cagrid/Example2008123102QueryProcessingException <http://gov.nih.nci.cagrid.data/DataServiceExceptions%7DQueryProcessingException:2009-01-02T16:10:53.122Zhttp://cabigbox.lab.ac.uab.edu:8080/wsrf/services/cagrid/Example2008123102QueryProcessingException> -- Error querying caCORE Application Service: Cannot access HTTP invoker remote service at [http://10.0.0.116:9080/example/http/applicationService]; <http://10.0.0.116:9080/example/http/applicationService%5D;> nested exception is java.io.IOException: Did not receive successful HTTP response: status code = 404, status message = [Not Found]2009-01-02T16:10:53.122ZFound that I had earlier deleted the sample model's WAR file from $CATALINA_HOME/webapps directory due to insufficient disk space on 10.0.0.116. By restoring it, was finally successful in querying the sample model's data from caGrid's training portal.
Attachments
- caCORE SDK 4.0 Developer's Guide_101007.pdf (4.0 MB) -
Developer's Guide to caCORE SDK - 4.0
, added by ppreddy@uab.edu on 01/15/09 13:51:24.
