[Biojava-l] BioJava Servlet in Tomcat

Thomas Down td2@sanger.ac.uk
Fri, 17 Aug 2001 16:49:58 +0100


[Cross-posted to the DAS list, since this could hit people
running Dazzle]

A couple of weeks ago, we updated BioJava to use the JAXP1.1
APIs for constructing XML parsers, rather than explicitly
depending on Xerces.  This has been working very well for
most people, but has caused a few problems in conjunction with
the Tomcat servlet container.

Tomcat also uses JAXP for constructing XML parsers, but
it ships with a rather old parser from Sun which isn't 100%
compatible with some XML code in BioJava.  In Tomcat 3.2,
the classloader structure is such that all servlets are
stuck with whichever XML parser Tomcat is using.

Note that Tomcat 3.3 uses more sophisticated mechanisms to
insulate servlets from their execution environment, so this
issue does not apply.

For Tomcat 3.2 users, I would recommend the following steps:

  - Shut down the servlet container.

  - Delete the files `jaxp.jar' and `parser.jar' from the
    Tomcat lib/ directory.

  - Replace these with a recent version of the Xerces-J
    XML parser (1.4.0 recommended).

  - Restart the container.

Tomcat works fine with Xerces, and making this change means
that BioJava (and any other applications which want a fully
namespace-aware parser) should work nicely, too.


You can get Xerces from:

  http://xml.apache.org/

There is also a copy in the BioJava download area:

  http://www.biojava.org/download/binaries/

Don't even bother asking why Tomcat isn't using Xerces (another
Apache project) already...

   Thomas.