XSLT problem
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Thomas_Mathew
Posted On:   Tuesday, December 11, 2001 01:24 AM

i'm using tomcat 4.0 for jsp , jaxp-1.1 for xml have put xalan jar in $TOMCAT_HOME/common/lib other 2 jar files crimson,jaxp are there by default .. i have searched the java , jguru forums but could not fix this. code is given below <%@ page import="javax.xml.transform.dom.DOMSource"%> <%@ page import="java.io.*,javax.xml.parsers.*,saxbean.*"%> <%@ page import="javax.xml.transform.TransformerFactory"%> <%@ page import="javax.xml.transform.Transformer"%> <%@ page import="org.w3c.dom.Document"%> <%@ page import="javax.xml.transform.stream.StreamSource"%> <%@ page import="javax.x   More>>

i'm using tomcat 4.0 for jsp , jaxp-1.1 for xml
have put xalan jar in $TOMCAT_HOME/common/lib
other 2 jar files crimson,jaxp are there by default ..
i have searched the java , jguru forums but could not fix this.
code is given below
<%@ page import="javax.xml.transform.dom.DOMSource"%>
<%@ page import="java.io.*,javax.xml.parsers.*,saxbean.*"%>
<%@ page import="javax.xml.transform.TransformerFactory"%>
<%@ page import="javax.xml.transform.Transformer"%>
<%@ page import="org.w3c.dom.Document"%>
<%@ page import="javax.xml.transform.stream.StreamSource"%>
<%@ page import="javax.xml.transform.stream.StreamResult"%>
<%@ page import="javax.xml.transform.TransformerConfigurationException"%>

<%
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder dg = dbf.newDocumentBuilder();
Document doc = dg.parse("c:/sax.xml");
if(doc!=null){
StringWriter output = new StringWriter();
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(output);
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
transformer.transform(source,result);
out.print(output.toString());
}
%>


this line throws Exception
TransformerFactory tFactory = TransformerFactory.newInstance();
following exception
java.lang.LinkageError: Class org/w3c/dom/Node violates loader constraints
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
pls how to resolve
thanks in advance.

   <<Less
About | Sitemap | Contact