Hi,
By now we are all becoming familiar with the story that there are problems attempting
to run the latest Xalan from Apache with Sun's 1.4.x JDK because an older version
of Xalan (2.2D11) is built into the rt.jar along with the Crimson parser.
Yesterday I ran into an interesting problem with Xerces and Xalan
in this context. If you put current versions of both xalan.jar and xercesImpl.jar
on the command line classpath or in the ...jre/lib/endorsed dir, it works fine.
The old xalan and crimson classes in rt.jar are ignored. But if you just put
xercesImpl.jar on the command line or in the endorsed dir, the following error is
thrown.
java.lang.ClassNotFoundException: org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:135)
at org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:269)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:630)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
at org.apache.xalan.xslt.Process.main(Process.java:865)
Of course at first, the error seemed inexplicable, but if you look at
DTMManagerDefault.java, it has the following code
boolean haveXercesParser =
(null != reader)
&&
(reader.getClass().getName().equals("org.apache.xerces.parsers.SAXParser") );
So it looks like Xalan wants to load the IncrementalSAXSource_Xerces class when it
detects
an available Xerces parser and this class is not in the built-in D11 Xalan (it is in
the current
xalan.jar though). Maybe the location of that class has changed? Looks like this
reflects
a problem with an older version of Xalan trying to use a newer Xerces parser. I'm not
sure what this means or whether anything needs to be changed in Xalan going forward.
Just wanted to bring it to your attention.
Tom