You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Muthuramu, Suganthi (Cognizant)" <Su...@cognizant.com> on 2006/05/26 22:54:49 UTC

error while using SAX parser.

Hi,

 

            I am getting the following error, when I try to upgrade the
version to xalan 2.7.0. I am using the xml-apis.jar and xercesImpl.jar
that comes along with the xalan2.7.0. The Java version is 1.4.2_08 and I
am using jdom b7.

 

The below code works fine with standalone java application, but if this
code is deployed in iplanet webserver, I am getting this error,
java.lang.RuntimeException: Error in building: SAX2 driver class
org.apache.xerces.parsers.SAXParser does not implement XMLReader

 

 

            InputStream istream =
getClass().getResourceAsStream("stylesheet.xsl");

                        StringWrite soapMessage = new StringWriter();

                        TransformerFactory tFactory =
TransformerFactory.newInstance();

                        StreamSource ss = new StreamSource(istream);

                        Transformer transformer =
tFactory.newTransformer(ss);

                        sr = new StringReader(response); 

                        transformer.transform(new StreamSource(sr), new
StreamResult(soapMessage));

 

 

            Could you please help me to solve this issue? Where else I
need to include the new jars apart from the classpath?

 

 

 

Regards

Suganthi Muthuramu

 


Re: error while using SAX parser.

Posted by Dave Brosius <db...@apache.org>.
Often this is caused by two versions of xalan/xerces on the path, most probably iPlanet includes older jars for it's own needs. When you configure your application inside of iPlanet, there is probably an option to select different class loading policies, such as parent first (use iPlanet's jars first) or parent last (use your jars first).
You want to use your jars, so parent last is the option to choose. I have no experience with iPlanet, however, and am just giving general ideas.
  ----- Original Message ----- 
  From: Muthuramu, Suganthi (Cognizant) 
  To: xerces-j-user@xml.apache.org 
  Sent: Friday, May 26, 2006 4:54 PM
  Subject: error while using SAX parser.


  Hi,

   

              I am getting the following error, when I try to upgrade the version to xalan 2.7.0. I am using the xml-apis.jar and xercesImpl.jar that comes along with the xalan2.7.0. The Java version is 1.4.2_08 and I am using jdom b7.

   

  The below code works fine with standalone java application, but if this code is deployed in iplanet webserver, I am getting this error, java.lang.RuntimeException: Error in building: SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement XMLReader

   

   

              InputStream istream = getClass().getResourceAsStream("stylesheet.xsl");

                          StringWrite soapMessage = new StringWriter();

                          TransformerFactory tFactory = TransformerFactory.newInstance();

                          StreamSource ss = new StreamSource(istream);

                          Transformer transformer = tFactory.newTransformer(ss);

                          sr = new StringReader(response); 

                          transformer.transform(new StreamSource(sr), new StreamResult(soapMessage));

   

   

              Could you please help me to solve this issue? Where else I need to include the new jars apart from the classpath?

   

   

   

  Regards

  Suganthi Muthuramu

   

RE: error while using SAX parser.

Posted by Andrew Stevens <at...@hotmail.com>.
>From: "Muthuramu, Suganthi (Cognizant)" <Su...@cognizant.com>
>Date: Sat, 27 May 2006 02:24:49 +0530
>
>Hi,
>
>             I am getting the following error, when I try to upgrade the
>version to xalan 2.7.0. I am using the xml-apis.jar and xercesImpl.jar
>that comes along with the xalan2.7.0. The Java version is 1.4.2_08 and I
>am using jdom b7.
>
>The below code works fine with standalone java application, but if this
>code is deployed in iplanet webserver, I am getting this error,
>java.lang.RuntimeException: Error in building: SAX2 driver class
>org.apache.xerces.parsers.SAXParser does not implement XMLReader

Looks like the classloader in iPlanet is still finding an older Xerces 
version from somewhere.  What verson of iPlanet is it (6.1 and 6.0 handle 
the classpath configuration differently for web apps)?

>             Could you please help me to solve this issue? Where else I
>need to include the new jars apart from the classpath?

Which classpath?  The global environment variable, the server instance's 
conf/jvm12.conf file (if 6.0), or did you just put it in WEB-INF/lib in the 
application (which should automatically be included in the classpath in 
6.1)?


Andrew.



---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org