MyGrid Notification Service
This might allow us to use asynchronous notification for "vanilla" Web Services, without needing to use OGSI/WSRF. I'll use this page to document my progress with installing and using the service on our systems.
Obtaining the software
I downloaded the latest available version (notification-src-0.4.2.tar.gz) from
http://cvs.mygrid.org.uk/notification-stable/downloads/.
Installing the software
(Note that I am attempting to install the software on a Linux-based system (Red Hat 9.0) with the Sun Java SDK 1.4.2. Linux has apparently not yet been tested so this should be interesting!)
- I extracted the .tar.gz archive to a new directory (in $HOME/docs. From now on, the directory $HOME/docs/mygrid/notification will be known as
mygrid-install-dir).
- Printed out
mygrid-install-dir/doc/quickstart.doc. I'm using this as my guide from now on.
- (see section 3.3.1 of quickstart.doc). Installed Tomcat 4.1.24 by extracting the .tar.gz file into /home/jdb/programs (on my local hard drive).
- N.B. I tried the latest Tomcat (5.0.19) but got errors when validating the Axis installation with happyaxis.jsp. It seems that the activation.jar file is missing in 5.0.19.
- Installed Apache Axis 1.0 into the Tomcat installation by copying the
$AXIS_ROOT/webapps/axis directory into /home/jdb/programs/jakarta-tomcat-4.1.24/webapps.
- Set the environment variable
$CATALINA_HOME to /home/jdb/programs/jakarta-tomcat-4.1.24 and added $CATALINA_HOME/bin to my $PATH.
- Tested the Tomcat/Axis installation by running
startup.sh and going to http://localhost:8080/axis/happyaxis.jsp. The configuration looked OK, except that an optional component (xmlsec.jar) couldn't be found (will be installed next).
- N.B. I used Axis 1.0 and not 1.1 because I've found that some of the changes in 1.1 have caused me problems in the past. I'll upgrade later if all goes well.
- Downloaded xml-security-bin-2_0.jar from http://ftp.plig.net/pub/apache/dist/xml/security/java-library. Extracted the .jar archive and copied xmlsec.jar to
$CATALINA_HOME/webapps/axis/WEB-INF/lib.
- Restarted Tomcat (shutdown.sh; startup.sh) and opened
http://localhost:8080/axis/happyaxis.jsp again. This confirmed that xmlsec.jar had been found.
- Note that, despite the claim in quickstart.doc, I didn't find this library in the
mygrid-install-dir/mygrid/notification/add directory (indeed, there were no libraries in this directory).
- Downloaded
Xerces-J-bin.1.4.4.zip from http://xml.apache.org/dist/xerces-j/, extracted the archive and copied xerces.jar into $CATALINA_HOME/webapps/axis/WEB-INF/lib.
- There is a newer version (2.5.0) which I might install later if all goes well
- Is this the right place for it? quickstart.doc doesn't say. I guess it's fine if it's in the
CLASSPATH.
- MySQL has already been installed on another machine
- Downloaded openjms-0.7.6.tar.gz from http://openjms.sourceforge.net/downloads.html. Extracted the
.tar.gz file to /usr/local.
- Didn't find JDBC 2.0 driver for mySQL in the mygrid install directory. MM-MySQL has changed to MySQL connector. I already have Connector version 3.0.8. Copied
mysql-connector-java-3.0.8-stable-bin.jar to $JAVA_HOME/jre/lib/ext to install it.
- Already have JUnit 3.8.1 in
/usr/local/junit3.8.1.
- Already have Apache Ant versions 1.5.3-1 and 1.6.0 (some things changed between the versions so I'm not sure whether 1.6.0 will be suitable. I'll use 1.6.0 for the moment and see how I get on)
- Downloaded Antmerge version 1.1.0 from http://www.russet.org.uk/download/java/antmerge/ and installed in
/usr/local/antmerge-1.1.0.
Settings
-
rt.jar and junit.jar are already in the CLASSPATH.
- Added Antmerge bin directory (
/usr/local/antmerge-1.1.0.bin ) to PATH. (Ant and Java were already in my PATH).
- set the environment variables
$TOMCAT_HOME and $OPENJMS_HOME ( $JAVA_HOME is already set).
- Modified
mygrid-install-dir/config/tcp_jms_jdbc.xml to use correct MySQL driver and database location.
- Renamed
$ANTMERGE_HOME/bin/antmerge.sh to antmerge.
Building software
- Copied the required jar files to $HOME/docs/mygrid/notification/ext (this is in place of doing
ant gather):
axis-ant.jar, jaxrpc.jar, servlet.jar, axis.jar, jms-1.0.2a.jar, wsdl4j.jar, castor-0.9.5.jar, log4j-1.2.4.jar, xerces.jar, commons-discovery.jar, mysql-connector-java-3.0.8-stable-bin.jar, xml-apis.jar, commons-logging.jar, openjms-0.7.6.jar, xmlParserAPIs.jar, exolabcore-0.3.7.jar, saaj.jar, xmlsec.jar
- Made small changes to the build.xml file to reflect this (mainly updates in version numbers of jar files). New version of build.xml is attached to this page: build.xml.
- From $HOME/docs/mygrid/notification, ran:
ant (Build successful)
ant jarsamples (Build successful)
ant jartests (Build successful)
The $HOME/docs/mygrid/notification/lib directory now contains the files notification.jar, notification-samples.jar, notification-test.jar and notification.war
Creating repositories
- Created a MySQL database called
mygridnotification and granted access to the openjms user:
mysql -h <hostname> -u <username> -p
(entered password)
create database mygridnotification;
use mygridnotification;
grant all privileges on mygridnotification.* to openjms identified by 'password' with grant option;
- Made changes to $HOME/docs/mygrid/notification/bin/create_jms_db.sh and create_mgns_db.sh to reflect location of database and different mysql driver and location of the creation script (which is $OPENJMS_HOME/config/db/create_mysql.sql).
- Changed to $HOME/docs/mygrid/notification/bin and ran create_jms_db.sh. Now have 7 tables in the mygridnotification database
- Ran create_mgns_db.sh. Now have 13 extra tables, all starting "mgns_" (quickstart.doc only lists 9 of these tables).
Configuration
OpenJMS messaging server
- Copied
$HOME/docs/mygrid/notification/ext/mysql-connector-java-3.0.8-stable-bin.jar to $OPENSJMS_HOME/lib.
- Copied
$HOME/docs/mygrid/notification/add/setenv.sh and startup.sh to $OPENSJMS_HOME/bin.
- Edited
$OPENSJMS_HOME/bin/setenv.sh to reflect new name of MySQL driver jar file.
- Copied
$HOME/docs/mygrid/notification/config/tcp_jms_jdbc.xml to $OPENSJMS_HOME/config.
Tomcat
- Created a Tomcat user with the manager role by adding to
$CATALINA_HOME/conf/tomcat-users.xml a user like this: <user username="craigmcc" password="secret" roles="tomcat,manager,admin" /> and the roles admin and manager.
- Edited
$HOME/docs/mygrid/notification/init.properties to reflect current installation (version numbers of dependencies, directory of .jar files, WEBINF_CLASS_DIR, password for Tomcat Manager)
Deployment
- MySQL is already started.
- Started OpenJMS with
$OPENJMS_HOME/bin/startup.sh &.
- Tomcat already started.
- From
$HOME/docs/mygrid/notification, ran ant deploy.
- Had to add
$CATALINA_HOME/server/lib/catalina-ant.jar to classpath of "deploy" target in build.xml: see the build.xml that's attached to this page.)
- Got "build successful" - apparently it's deployed...
Testing
- Edited
$HOME/docs/mygrid/notification/bin/testfirst.sh to include junit.jar and servlet.jar in the classpath (I found servlet.jar in $CATALINA_HOME/common/lib).
- Got a load of Axis errors "The AXIS engine could not find a target service to invoke!" Perhaps the services haven't been deployed properly?
--
JonBlower - 24 Feb 2004
Topic revision: r5 - 15 Mar 2004 - 17:31:00 -
JonBlower