XSLTProcessorFactory.getProcessor() - no exception but no error
Hi,
I have a web application that is trying to create a HTML using an XML and XSLT. I have it deployed on WebLogic 8.1 sp5, jdk 1.4.2
Here is a piece of the code:
..............
//XSL Processors
import org.apache.xalan.xslt.XSLTProcessorFactory;
import org.xml.sax.SAXException;
public class SrvltStaticMaintenanceFilter extends HttpServlet {
public final void doPost(HttpServletRequest request, HttpServletResponse response){
try{
................
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
System.out.println("test 5");
System.out.println("processor = " + processor );
System.out.println("test 6");
} catch(SAXException e){
System.out.println("SAXException = " + e);
} catch(Exception e){
System.out.println("ERROR = " + e.getMessage());
}
}
The code is not working, but funny enough there is no error displayed. The html page generated is empty
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
"test 5" is displayed, "test 6" is not.
xalan.jar is in the classpath
Any ideas? Thanks
# 2
I did that. I created a simple class:
...
try{
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
} catch(SAXException se){
System.out.println(se);
}
....
and it works find on Windows. When I run it on AIX server, I am getting:
Exception in thread "main" java.lang.VerifyError: (class: org/apache/xalan/xpath/xdom/XercesLiaison, method: parse signature: (Lorg/xml/sax/InputSource;)V) Incompatible object argument for method call
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:180)
at org.apache.xalan.xslt.XSLTEngineImpl.<init>(XSLTEngineImpl.java:360)
at org.apache.xalan.xslt.XSLTProcessorFactory.getProcessor(XSLTProcessorFactory.java:79)
at Test.main(Test.java:14)
How can I remove the hardcoded reference to Xalan?
Thanks
# 4
I found the cause.
xalan.jar contains the class org.xml.sax.InputSource
xml.jar (that comes with jdk 1.4 for AIX) has also this class and because it it loaded first, when I run the code:
XSLTProcessorFactory.getProcessor()
it is trying to use it.
I tried to remove xml.jar and even to remove the InputSource from the jar but then the WebLogic server is complaining when using this class from the xalan.jar
Unfortunately, using the old version of xalan.jar is a requirement :(