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


Reply via email to