-
Notifications
You must be signed in to change notification settings - Fork 1
The Web Service
##Preparing the web service A very simple way to run the server component for the web service is to run it via the Maven Jetty plug-in. Do that by:
- go to the root source folder and issue 'mvn -P... install', as explained above (Jetty will work with the in-memory HSQL database if you don't use -P).
- cd myequivalents-web and issue 'mvn -P... jetty:run'
If you don't notice any error message in the output of such command, you should be able to check that the service is up and running by means of any web browser. For instance, a URL that should work is this, which gets some test data stored when you trigger the Jetty plug-in (the database is untouched when you deploy the .war file, unless you pass uk.ac.ebi.fg.myequivalents.test_flag=true to the JVM). The browser should show the same XML reported in the examples above.
You can keep the Maven/Jetty instance running and use it to test the web service client (see below).
##Setting up into an application server, Tomcat
- Build the war, issuing 'mvn -P... package' from either the top level or the myequivalents-web module. See above for details about Maven profiles.
- from myequivalents-web, run ./deploy2tomcat.sh <TOMCAT_HOME> [app-context-path] [app-config-dir]. This assumes you're under some Unix system or using an equivalent environment (e.g., Cygnus). The script will copy the generated .war file and the myeq-manager-config.xml that corresponds to the database profile selected with -P. The script asks if you want to replace existing files.
- This means that you can change database parameters on the Tomcat home, even after installation, by changing the myeq-manager-config.xml file.
- If you want test-data loaded into the myequivalents database, type (under Bash shell):
$ export JAVA_OPTS='-Duk.ac.ebi.fg.myequivalents.test_flag=true'
- Start or run the server, e.g. 'cd $TOMCAT_HOME/bin; ./catalina.sh run'
- You should be able to see some mappings via an URL like this
You can change the web application root '/myequivalents' by changing the name of the .war file mentioned above. Please note, that there is no way you can detach the name of a .war file from the application id that Tomcat maps the file to. Instead, you can name the file like examples#myeq, to get it mapped to /examples/myeq. This is done automatically by the deployment script above (using slashes in app-context parameter).
##Setting up into an application server, non Tomcat Although we officially support Jetty and Tomcat only, the generated web application should work with any standard Java application server. What you need to do is:
- Copy the .war into a proper destination
- Create a configuration directory named something like myequivalents-conf into an approriate location
- After having built the myequivalents-web module, as explained above, copy target/classes/myeq-manager-config.xml into the configuration directory.
- Copy context.xml into a location and name approriate for your application server. For instance, into <server_home>/conf/myequivalents.xml. The server should be able to associate this context file to the binary file myequivalents.war.
- Modify the copy of context.xml that you placed into the server, in order to set the above mentioned configuration directory via the 'myequivalents.config-location' parameter.
- If you want test data, set the Java option uk.ac.ebi.fg.myequivalents.test_flag=true (in whatever way your server's documentation tell to do so).
- Restart the server (or deploy myequivalents.war).