Skip to main content

Metro on Tomcat 6.x

Posted by arungupta on July 23, 2007 at 6:04 AM PDT

Rama described how
to run

JAX-WS samples with Tomcat 6.x
is part of Metro - the Web services
stack in GlassFish. Another key
component of Metro is WSIT (aka Project
Tango) that provides Secure, Reliable, Transactional and Interoperable Web
service. Read more about Project Tango in
this 26-page article.

A stable version of Metro is integrated in

GlassFish V2
and the

latest nightlies
of stand-alone bundle are also available. The stand-alone
bundle comes with an install scipt (wsit-on-tomcat.xml) that allows
it install on Tomcat 5.x. I followed the steps in

Rama's blog
to install Metro on Tomcat 6.x. But first, a little bit of
explanation and then the actual code fragments.

Tomcat's classloading mechanism has changed slightly between
. The first change is that Tomcat 5.x used to have shared/lib
directory to share classes across all web applications. This directory in turn
used to be specified as value of shared.loader property in 
conf/ In Tomcat 6.x, the property still exists
but it's value is set to nothing and shared/lib directory no longer
exists in the default installation. I see the motivation behind this change as
it keeps the Tomcat installation directory clean and any shared resources can
still be specified in conf/ But this means that
wsit-on-tomcat.xml script, that copies the files in

directory, will work on Tomcat 5.x only. In order for this
script to work on Tomcat 6.x, the value of shared.loader property
need to be changed to include Metro jars.

Now, the code fragments! The value of shared.loader property in
Tomcat 5.x is:


And in Tomcat 6.x is the value of this property is:


If Metro is installed in c:\metro then changing its value to:


will enable Tomcat 6.x to host Secure, Reliable, Transactional and .NET
3.0-Interoperable Web services. And this mechanism will work for Tomcat 5.x too,
so changing the value of this property in Tomcat 5.x installation to:


instead of copying the files in shared/lib will be sufficient as

The second change in Tomcat's classloading mechanism is required if you are
using Java SE 6. Tomcat 5.x used to have common/endorsed directory
which no longer exists in Tomcat 6.x. Java SE 6 is bundled with JAX-WS 2.0 and
Metro needs JAX-WS 2.1. So if you are using Java SE 6 then copy

in c:/jdk6/jre/lib/endorsed directory.

Endorsed Directory Mechanism
for more details.

Several screencasts
are available that show how to develop Secure, Reliable and Transactional and
Interoperable Web service. All the screencasts use NetBeans IDE but if you are
more of a command-line user then follow
entry that shows how to develop a reliable endpoint and invoke it from WCF and
vice versa.



Related Topics >>