Installation: MDR Query Service
Step 1. Install the Prerequisites
MDR Query Service depends upon a number of libraries and software components. Make sure you download the software prerequisites and configure your environment properly to use MDR Query Service.
- Java 1.5 JDK
and JAVA_HOME env defined - Ant 1.7.0
and ANT_HOME env defined - caGrid-customized Globus WS Core 4.0.3
unzipped and GLOBUS_LOCATION env defined - (optional) Tomcat 5.5.27 Core
installed and "CATALINA_HOME" env defined with Globus deployed to it - (optional) JBoss 4.0.5GA
installed and "JBOSS_HOME" env defined with Globus deployed to it
Step 2. Obtain a Software Release
| Skip this step if you have already checked out the code and built openMDR at the root level as per mdrCore installation instructions |
Download openMDR 1.0 Source Bundle
Download the source release: Source Code zip![]()
- Build Instructions: openMDR1.0
Obtain openMDR 1.0 from the Repository
You can connect to the openMDR repository and download the source code. This option is similar to downloading the source release, but has the benefit of getting you all the latest updates to the code since it was released. That is, the source code checkout always has the latest patches applied to fix bugs found since the openMDR release.
Source Code: Subversion Checkout on Linux
On Linux systems, use the commands shown below to check out from the SVN repository.
Source Code: Subversion Checkout on Windows
On Windows systems, we recommend the following 3rd party tool as a GUI front-end to subversion to check out a caGrid release: http://tortoisesvn.tigris.org
The command line version of subversion can be obtained from http://subversion.tigris.org![]()
openMDR 1.0 Release Stream
openMDR 1.0 Latest

openMDR 1.0

Development Stream

svn checkout https://gforge.nci.nih.gov/svnroot/grid-incubation/trunk/grid-incubation/incubator/projects/mdr/
| Note You might have to setup proxy variables in your svn profile if you are behind a firewall. |
* Setup environment variable "OPENMDR_HOME" for your source code checkout:
export OPENMDR_HOME=/home/mdrcore/projects/openMDR_1.0
Step 3. Build MDR Query Service (Optional)
Once you have mdr project checked out on your host system with Java, Ant and Globus prerequisites in place you can Build MDR Query Service. If you have built the project from root, you do not need to rebuild it.
a) Goto the the mdr project directory:
$ cd $OPENMDR_HOME/projects/mdrQuery
b) Run the target
$ ant all
| Note Make sure EXIST_HOME is set in the environment before running the above task. |
Step 4. Create a Container
You will need to configure the Tomcat or JBoss container that you installed in Step 1.
Tomcat will run by default on TCP/IP port number 8080. You will need to configure the port to something else like 9090 since you might already have ExistDb running on 8080 by default. In order to change port for tomcat make the following changes in the $CATALINA_HOME/conf/server.xml
Identify the line:
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" />
Modify it to:
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="9090" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" />
| Note If you changed your default port 8080 to any other port, follow Step 8 at the bottom of this page, before you continue further. |
Configuring Tomcat without Security (preferred)
- Download the appropriate version of tomcat, as detailed in the version of caGrid you are using.
- Create/Set the environment variable CATALINA_HOME to where you unzipped Tomcat
- Execute the following commands:

$cd "%GLOBUS_LOCATION%" $ant -f share\globus_wsrf_common\tomcat\tomcat.xml deployTomcat -Dtomcat.dir="%CATALINA_HOME%"
$ cd $GLOBUS_LOCATION $ 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: /Users/dhav01/projects/apache-tomcat-5.5.28/webapps/wsrf [copy] Copying 111 files to /Users/dhav01/projects/apache-tomcat-5.5.28/webapps/wsrf [mkdir] Created dir: /Users/dhav01/projects/apache-tomcat-5.5.28/webapps/wsrf/WEB-INF [copy] Copying 39 files to /Users/dhav01/projects/apache-tomcat-5.5.28/webapps/wsrf/WEB-INF [chmod] Skipping fileset for directory /Users/dhav01/projects/apache-tomcat-5.5.28/webapps/wsrf/WEB-INF. It is empty. [mkdir] Created dir: /Users/dhav01/projects/apache-tomcat-5.5.28/webapps/wsrf/WEB-INF/classes [copy] Copying 1 file to /Users/dhav01/projects/apache-tomcat-5.5.28/webapps/wsrf/WEB-INF/classes [copy] Copying 1 file to /Users/dhav01/projects/apache-tomcat-5.5.28/webapps/wsrf/WEB-INF/classes [mkdir] Created dir: /Users/dhav01/projects/apache-tomcat-5.5.28/webapps/wsrf/WEB-INF/lib [copy] Copying 1 file to /Users/dhav01/projects/apache-tomcat-5.5.28/webapps/wsrf/WEB-INF [copy] Copying 1 file to /Users/dhav01/projects/apache-tomcat-5.5.28/common/endorsed [copy] Copying 64 files to /Users/dhav01/projects/apache-tomcat-5.5.28/webapps/wsrf/WEB-INF/lib BUILD SUCCESSFUL Total time: 1 second
Configure JBoss Container
| Make sure JBoss 4.0.4 is installed and the JBOSS_HOME environment variable is set. Make sure you have installed, configured and built caGrid 1.3. Please refer to caGrid 1.3 installation documentation |
JBoss 4.0.4/4.0.5 installation guide: http://docs.jboss.org/jbossas/guides/installguide/r1/en/html/install.html
.
Be sure to install the Tomcat container into JBoss.
- Changes to Globus for JBOSS
In order to deploy Globus to the Tomcat in JBOSS Globus WSRF-Core needs two specific modifications.
- The AxisServlet needs to be able to support setting the root context based on the "webContext" variable set in the web.xml in the deployed wsrf.war/WEB-INF directory. Code exists in globus SVN head.
- The JNDIUtils needs to be modified to be able to suport adding the required context to the existing JNDI that JBOSS starts up. Code already exists in globus SVN head.
These required modifications all come in a modified and rebuilt wsrf-core.jar file which will be placed into
${jboss_globus_location}/lib
post deploying globus into JBOSS.
- Deploy Globus to JBOSS Tomcat
To deploy Globus to the Tomcat container within JBoss, execute the following commands:

$ cd $CAGRID_LOCATION/antfiles/jboss $ ant -f jboss.xml deployJBoss -Djboss.dir="<path to your jboss installation (typically $JBOSS_HOME)>"
Step 5. Deploy the MDR Query Service
Goto the mdrQuery project directory
$ cd $OPENMDR_HOME/projects/mdrQuery
* Deploy the MDR Query Service in an appropriate container according to your local installation. Following are the options available to deploy to respective containers. Use the one according to your local installation.
| Activity | Run Ant Task |
|---|---|
| Deploy to "GLOBUS_LOCATION" | [cagrid@mdr mdrQuery]$ ant deployGlobus |
| undeploy from "GLOBUS_LOCATION" | [cagrid@mdr mdrQuery]$ ant undeployGlobus |
| deploy to "CATALINA_HOME" | [cagrid@mdr mdrQuery]$ ant deployTomcat |
| undeploy from "CATALINA_HOME" | [[cagrid@mdr mdrQuery]$ ant undeployTomcat |
| deploy to "JBOSS_HOME" | [cagrid@mdr mdrQuery]$ ant deployJBoss |
| undeploy from "JBOSS_HOME" | [cagrid@mdr mdrQuery]$ ant undeployJBoss |
Step 6. Start the MDR Query Service
- start the container where you deployed the service
$ cd $CATALINA_HOME/bin $ sh startup.sh Using CATALINA_BASE: /home/cagrid/ext/tomcat Using CATALINA_HOME: /home/cagrid/ext/tomcat Using CATALINA_TMPDIR: /home/cagrid/ext/tomcat/temp Using JRE_HOME: /usr/local/java
- Access the URL where the service is deployed and verify.
Example: http://mdr.triadcommunity.org:9090/wsrf/services/cagrid/MDRQuery

- run the Client to test the Query service
[cagrid@mdr mdrQuery]$ cd $OPENMDR_HOME/projects/mdrQuery $ ant runClient
Check and modify the Query Service configuration against which you are running your client in run-tools.xml file. Change the value attribute in the tag <property name="service.url" ...> value
<project name="run-tools file" basedir="." default="runClient"> <target name="runClient" depends="checkGlobus, defineClasspaths" description="Run the sample Client"> <property name="service.url" value="http://mdr.triadcommunity.org:9090/wsrf/services/cagrid/MDRQuery" /> <echo message="Connecting to service: ${service.url}" /> <java failonerror="true" classname="org.cagrid.mdrq.client.MDRQueryClient" classpathref="run.classpath" fork="yes"> <jvmarg value="-DGLOBUS_LOCATION=${ext.globus.dir}" /> <arg value="-url" /> <arg value="${service.url}" /> </java> </target> </project> |
Step 7. Adding or Modifying Connectors: Configure Query Services for Searching Common Data Elements
Ideally you should have made modifications to the configuration file($OPENMDR_HOME/projects/mdrCore/db/mdr/connector/stylesheets/config.xml) when building the openMDR project at root level. However, if you are installing just the Query service, you can modify file $OPENMDR_HOME/projects/mdrQuery/etc/config.xml for changes in mdrCore(OPENMDR) service url.
- Copy the following content and paste it in the config file under <resource> element.
<query_service name="openMDR" identifier_prefix="cagrid.org" class="org.cagrid.openmdr.ws.query.RestQueryService" serviceUrl="http://localhost:8080/exist/rest/db/mdr/services" cache_collection_id="openMDR" cache="false" cache_provider="HibernateCacheProvider" category="CDE" connection_type="REST" requestSequence="openMDR_REST_query" digestSequence="openMDR_construct"> <title>Metadata Registry (openMDR)</title> <description>Metadata Registry (openMDR) </description> <webUrl>http://localhost:8080/exist/rest/db/mdr/resources/xquery/homepage.xquery</webUrl> </query_service>
- Edit the copied code in the config file to resemble something that you want to configure locally.
- Provide an appropriate name to the <query_service... "name" attribute. Make sure there are no duplicate names in the services.
- Enter the name provided above as the value for "cache_collection_id"
- Provide identifier_prefix: This value should be unique and should be something specific to the organization as Identifiers in mdrCore will be created using this as prefix, and the same will be used to resolve them.
- Provide appropriate url for the <query_service... "serviceURL" attribute.
- Make sure "category" attribute has a value of "CDE" for Common Data Element(CDE's) Query Services.
- Make appropriate changes in the "<title>" and "<description>" tag values

Please do not make any other changes to the configuration. <query_service name="Local-openMDR" identifier_prefix="osu.edu" class="org.cagrid.openmdr.ws.query.RestQueryService" serviceUrl="http://localhost:8080/exist/rest/db/mdr/services" cache_collection_id="Local-openMDR" cache="false" cache_provider="HibernateCacheProvider" category="CDE" connection_type="REST" requestSequence="openMDR_REST_query" digestSequence="openMDR_construct"> <title>Metadata Registry (openMDR)</title> <description>Metadata Registry (openMDR) </description> <webUrl>http://localhost:8080/exist/rest/db/mdr/resources/xquery/homepage.xquery</webUrl> </query_service>
Step 8. (Optional) Configure mdrQuery Client to run against the local mdr Query Service. You will need to provide the Query service URL and port as inputs.
$ ant configRunClient
Buildfile: build.xml
configRunClient:
[echo] Enter the values where mdrQuery Service is deployed
[input] mdrQuery Service Host
[input]
mdr.triadcommunity.org
[input] mdrQuery Service Port
[input]
9090
[echo] Previous Host : localhost
[echo] Previous Port : 8080
[echo] Entered Host : mdr.triadcommunity.org
[echo] Entered Port : 9090
[echo] MDR Query URL has been updated
BUILD SUCCESSFUL





