You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Gary L Peskin <ga...@firstech.com> on 2001/05/18 18:04:08 UTC

Re: Xalan: Exception on JSP page

Your servlet container is doing something with the classpath that is
causing you to get an older version of the DOM classes in the path ahead
of xerces.jar.  Download the EnvironmentCheck class

(http://xml.apache.org/websrc/cvsweb.cgi/~checkout~/xml-xalan/java/src/org/apache/xalan/xslt/EnvironmentCheck.java?rev=1.3)

and insert the following line immediately before your
transformer.transform call:

  boolean environmentOK = (new
EnvironmentCheck()).checkEnvironment(yourPrintWriter);

This will show you your classpath and you should be able to identify the
older
version of the DOM classes that are causing this problem.

HTH,
Gary

> John Gouveia wrote:
> 
> Hi
> 
> Can anybody please help me with this problem. I am using Xalan-J
> 2.0.1. and using JSP's. If I execute the transformation in my bean via
> a main method it transforms successfully.
> 
> But if I access the same bean via a JSP page the transformation (with
> the same xsl and xml files) causes an exception at the 2nd last line
> of the code:
> 
>    DOMSource xmlIn= new DOMSource(xmlDocument);
>    StreamResult output = new StreamResult(new StringWriter());
> 
>    TransformerFactory tFactory = TransformerFactory.newInstance();
>    Transformer transformer = tFactory.newTransformer(new
> StreamSource("string url"));
>     transformer.transform(xmlIn, output);
> 
>      result = (output.getWriter()).toString();
> 
> the error message:
> 
> JspServlet: unable to dispatch to requested page:
> Exception:java.lang.NoSuchMethodError: boolean
> org.w3c.dom.Node.isSupported(java.lang.String, java.lang.String)
> 
> The only libraries I am using are servlet.jar(java.servlet package)
> and  Xerces and Xalan jar files. I have also checked my classpath for
> old XML files and there are none.
> 
> Has anybody got this error before.
> 
> thanks

Re: Xalan: Exception on JSP page

Posted by John Gouveia <jg...@camara.co.za>.
Thanks Gary for the code it really helped.

The Environment check came up with an error : "unable to load level 2 Dom" .
I am working on Oracle JDeveloper 3.2 so I had to update the xml files in
oracles xmlparser.jar.

Everything is working great now.

I appreciate your help.

cheers
John

----- Original Message -----
From: Gary L Peskin <ga...@firstech.com>
To: <xa...@xml.apache.org>
Cc: <xm...@apache.org>
Sent: Friday, May 18, 2001 6:04 PM
Subject: Re: Xalan: Exception on JSP page


> Your servlet container is doing something with the classpath that is
> causing you to get an older version of the DOM classes in the path ahead
> of xerces.jar.  Download the EnvironmentCheck class
>
>
(http://xml.apache.org/websrc/cvsweb.cgi/~checkout~/xml-xalan/java/src/org/a
pache/xalan/xslt/EnvironmentCheck.java?rev=1.3)
>
> and insert the following line immediately before your
> transformer.transform call:
>
>   boolean environmentOK = (new
> EnvironmentCheck()).checkEnvironment(yourPrintWriter);
>
> This will show you your classpath and you should be able to identify the
> older
> version of the DOM classes that are causing this problem.
>
> HTH,
> Gary
>
> > John Gouveia wrote:
> >
> > Hi
> >
> > Can anybody please help me with this problem. I am using Xalan-J
> > 2.0.1. and using JSP's. If I execute the transformation in my bean via
> > a main method it transforms successfully.
> >
> > But if I access the same bean via a JSP page the transformation (with
> > the same xsl and xml files) causes an exception at the 2nd last line
> > of the code:
> >
> >    DOMSource xmlIn= new DOMSource(xmlDocument);
> >    StreamResult output = new StreamResult(new StringWriter());
> >
> >    TransformerFactory tFactory = TransformerFactory.newInstance();
> >    Transformer transformer = tFactory.newTransformer(new
> > StreamSource("string url"));
> >     transformer.transform(xmlIn, output);
> >
> >      result = (output.getWriter()).toString();
> >
> > the error message:
> >
> > JspServlet: unable to dispatch to requested page:
> > Exception:java.lang.NoSuchMethodError: boolean
> > org.w3c.dom.Node.isSupported(java.lang.String, java.lang.String)
> >
> > The only libraries I am using are servlet.jar(java.servlet package)
> > and  Xerces and Xalan jar files. I have also checked my classpath for
> > old XML files and there are none.
> >
> > Has anybody got this error before.
> >
> > thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
> For additional commands, e-mail: xalan-cvs-help@xml.apache.org