views:

760

answers:

1

This is possibly related to a classpath problem, but I'm really not sure at this point, since I don't get this error on some machines.

The error at the top of the stack is SAX2 driver class org.apache.crimson.parser.XMLReaderImpl not found. Why would I get this error only in some environments, but not others? How can I further investigate and/or fix this?

Environments:

  • Jetty on Mac or PC == OK
  • Tomcat 5 or 6 on Mac == OK
  • Tomcat 5 or 6 on Win XP == ERROR
  • Tomcat 6 on CentOS == ERROR

Versions in the POM:

  • batik:batik:jar:1.5:compile
  • net.sf.saxon:saxon:jar:8.7:compile
  • batik:batik-transcoder:jar:1.6-1:compile
    • batik:batik-bridge:jar:1.6-1:compile
    • batik:batik-gvt:jar:1.6-1:compile
    • batik:batik-awt-util:jar:1.6-1:compile
    • batik:batik-util:jar:1.6-1:compile
    • batik:batik-gui-util:jar:1.6-1:compile
    • batik:batik-ext:jar:1.6-1:compile
    • xml-apis:xmlParserAPIs:jar:2.0.2:compile
    • batik:batik-script:jar:1.6-1:compile
    • batik:batik-svg-dom:jar:1.6-1:compile
    • batik:batik-dom:jar:1.6-1:compile
    • batik:batik-css:jar:1.6-1:compile
    • batik:batik-xml:jar:1.6-1:compile
    • batik:batik-parser:jar:1.6-1:compile
    • fop:fop:jar:0.20.5:compile
    • batik:batik-1.5-fop:jar:0.20-5:compile
    • xml-apis:xml-apis:jar:1.0.b2:compile
    • xalan:xalan:jar:2.4.1:compile
    • xerces:xercesImpl:jar:2.2.1:compile
    • avalon-framework:avalon-framework:jar:4.0:compile
A: 

It turns out that Apache XML Graphics itself adds Crimson to the classpath, twice. Once in the Apache Batik transcoder, and once in Apache FOP.

Since the libs are loaded alphabetically in Tomcat, FOP included Crimson, first, but then Batik also did the same.

I excluded FOP from the project POM, and have resolved the classpath issue.

Matt Fisher