xml-xalan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Amiro <Tom.Am...@Sun.COM>
Subject Re: Trax problem with Tomcat 4.0
Date Tue, 08 Jan 2002 22:15:28 GMT
Hi Reza,

Sorry for the delay in replying to you.

I have tried XSLTC with Tomcat 4.1 (as part of a yet
to become available early access release of Sun's Web Services Pack).
Although my platform is Unix and the error I got wasn't the same
as yours, maybe the workaround will still apply.

I was getting a ClassCastException with a servlet very much like yours,
until I put the xml-apis.jar in the Tomcat common/lib directory.
It looked like I was having class loader problems when the
xml-apis.jar was in my WEB-INF/lib directory. With an earlier
version of Tomcat (3.2.2), I had no such problem, so
something has changed with Tomcat.

Tom

Reza Shahsiah wrote:

> Hi,
>
> I am having a problem running the following code in tomcat 4.0:
>
> try {
> System.setProperty(
> "javax.xml.transform.TransformerFactory",
> "org.apache.xalan.xsltc.trax.TransformerFactoryImpl"
> // "org.apache.xalan.processor.TransformerFactoryImpl"
> );
> TransformerFactory tf = TransformerFactory.newInstance();
> tf.setAttribute("debug","true");
> String sys = "F:/tmp/xalan-j_2_2_D13/samples/SimpleTransform/";
>
> StreamSource xml = new StreamSource(new FileInputStream(sys + "birds.xml"));
> StreamSource xsl = new StreamSource(new FileInputStream(sys + "birds.xsl"));
> StreamResult htm = new StreamResult(out);
> Templates tm = tf.newTemplates(xsl);
> Transformer tr =tm.newTransformer();
> tr.transform(xml, htm);
> }
> catch (Exception ex) {
> //ex.printStackTrace();
> throw new ServletException(ex.toString());
> }
>
> it works fine outside Tomcat, but encounters following exception (four lines
> of stack trace) in a sevlet or jsp:
>
> javax.xml.transform.TransformerConfigurationException: 58GregorSamsa
> at
> org.apache.xalan.xsltc.trax.TemplatesImpl.defineTransletClasses(TemplatesImp
> l.java:200)
> at
> org.apache.xalan.xsltc.trax.TemplatesImpl.getTransletInstance(TemplatesImpl.
> java:214)
> at
> org.apache.xalan.xsltc.trax.TemplatesImpl.newTransformer(TemplatesImpl.java:
> 246)
> at org.apache.jsp.index$jsp._jspService(index$jsp.java:96)
>
> I have debugged it remotely, and I guess the problem is in class loaders.
> The exception handling is rather bad, and messages are not so informative.
>
> Thank you,
> Reza


Mime
View raw message