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 "Dr. Edward R. Jones" <ej...@falcon.tamucc.edu> on 2002/07/09 16:17:52 UTC

Xerces 2.01 + Tomcat 4.0.1 problem

Hi, I've looked high and low for documentation on dynamic class loading for tomcat 4.0.1.  Can't seem to find an answer to this problem.  I'm trying to use Xerces-J 2.0.1 parser in a class using the tomcat.

I receive the following message:

Preparing to create XML Reader using Xerces Parser
java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParser
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:130)
        at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown 
Source)
        at ValidatorService.validate(ValidatorService.java:60)

etc...

This came from the following java statement:

XMLReader reader = 
XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");

Is this a Tomcat, Xerces or dumb user problem?

thanks - edwardJones
-- 
****************************************************************************
 Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
 Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840 
****************************************************************************



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


Re: Xerces 2.01 + Tomcat 4.0.1 problem

Posted by Xavier Renard <Xa...@ulg.ac.be>.
Hi

Seems to me like a classpath problem. Tomcat can not find the implementation
of the SAX API. Where have you put the xerces jar files?
Maybe have a try in putting these in $CATALINA_HOME/common/lib or
$CATALINA_HOME/webapps/name-app/web-inf/lib/

Hope this help

Xavier

> Hi, I've looked high and low for documentation on dynamic class loading
for tomcat 4.0.1.  Can't seem to find an answer to this problem.  I'm trying
to use Xerces-J 2.0.1 parser in a class using the tomcat.
>
> I receive the following message:
>
> Preparing to create XML Reader using Xerces Parser
> java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParser
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:130)
>         at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown
> Source)
>         at ValidatorService.validate(ValidatorService.java:60)
>
> etc...
>
> This came from the following java statement:
>
> XMLReader reader =
> XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
>
> Is this a Tomcat, Xerces or dumb user problem?
>
> thanks - edwardJones
> --
>
****************************************************************************
>  Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
>  Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840
>
****************************************************************************
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org



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


Re: Xerces 2.01 + Tomcat 4.0.1 problem

Posted by "Dr. Edward R. Jones" <ej...@falcon.tamucc.edu>.
Hi Rishi,

Your suggestion below seems to be working.  Don't know why this is the 
case.  The xercesImpl.jar file is in common/lib and I also tried putting 
it in the WEB-INF/lib directory.  Even un-jared the file and put the 
class in WEB-INF/classes directory.. not of this worked.  Always got a 
ClassNotFound exception for "org.apache.xerces.parses.SAXParser"... and 
yes.. xercesImpl.jar is in the classpath for tomcat.

At any rate.. your suggestions seems to be an effective workaround.

Thanks a bunch - edwardJones
On Tue, 
9 Jul 2002, 
Rishi Khanna wrote:

> This might be a classpath issue.  I've used the same code and it works.  You
> can also try bypassing the XMLReaderFactory class, and use the following
> call:
> 
> XMLReader parser = (XMLReader)
> Class.forName("org.apache.xerces.parsers.SAXParser").newInstance();
> 
> If you get the same exception, my first hunch is some path issue.
> 
> 
> ----- Original Message -----
> From: "Dr. Edward R. Jones" <ej...@falcon.tamucc.edu>
> To: <xe...@xml.apache.org>
> Sent: Tuesday, July 09, 2002 10:17 AM
> Subject: Xerces 2.01 + Tomcat 4.0.1 problem
> 
> 
> > Hi, I've looked high and low for documentation on dynamic class loading
> for tomcat 4.0.1.  Can't seem to find an answer to this problem.  I'm trying
> to use Xerces-J 2.0.1 parser in a class using the tomcat.
> >
> > I receive the following message:
> >
> > Preparing to create XML Reader using Xerces Parser
> > java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParser
> >         at java.lang.Class.forName0(Native Method)
> >         at java.lang.Class.forName(Class.java:130)
> >         at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown
> > Source)
> >         at ValidatorService.validate(ValidatorService.java:60)
> >
> > etc...
> >
> > This came from the following java statement:
> >
> > XMLReader reader =
> > XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
> >
> > Is this a Tomcat, Xerces or dumb user problem?
> >
> > thanks - edwardJones
> > --
> >
> ****************************************************************************
> >  Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
> >  Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840
> >
> ****************************************************************************
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> 

-- 
****************************************************************************
 Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
 Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840 
****************************************************************************


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


Re: Xerces 2.01 + Tomcat 4.0.1 problem

Posted by Rishi Khanna <ri...@rishikhanna.com>.
This might be a classpath issue.  I've used the same code and it works.  You
can also try bypassing the XMLReaderFactory class, and use the following
call:

XMLReader parser = (XMLReader)
Class.forName("org.apache.xerces.parsers.SAXParser").newInstance();

If you get the same exception, my first hunch is some path issue.


----- Original Message -----
From: "Dr. Edward R. Jones" <ej...@falcon.tamucc.edu>
To: <xe...@xml.apache.org>
Sent: Tuesday, July 09, 2002 10:17 AM
Subject: Xerces 2.01 + Tomcat 4.0.1 problem


> Hi, I've looked high and low for documentation on dynamic class loading
for tomcat 4.0.1.  Can't seem to find an answer to this problem.  I'm trying
to use Xerces-J 2.0.1 parser in a class using the tomcat.
>
> I receive the following message:
>
> Preparing to create XML Reader using Xerces Parser
> java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParser
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:130)
>         at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown
> Source)
>         at ValidatorService.validate(ValidatorService.java:60)
>
> etc...
>
> This came from the following java statement:
>
> XMLReader reader =
> XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
>
> Is this a Tomcat, Xerces or dumb user problem?
>
> thanks - edwardJones
> --
>
****************************************************************************
>  Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
>  Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840
>
****************************************************************************
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>


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


RE: Xerces 2.01 + Tomcat 4.0.1 problem

Posted by Ragunath Marudhachalam <rm...@circuitvision.com>.
Hi Edward,

Move the xercesImpl.jar into tomcat\common\lib. and make sure the version of
the parser you are compiling and the version of the parser in the tomcat are
the same.

Ragu
CircuitVision



-----Original Message-----
From: Dr. Edward R. Jones [mailto:ejones@falcon.tamucc.edu]
Sent: Tuesday, July 09, 2002 11:35 AM
To: xerces-j-user@xml.apache.org
Subject: RE: Xerces 2.01 + Tomcat 4.0.1 problem


Hi Ragu,

Thanks for the reply, but javax.xml.parsers.SAXParser is the default jaxp
parser.  I'm trying to use the Xerces parser which is in
org.xml.xerces.parsers.SAXParser.  The java code mentioned below works
fine when I run the code outside tomcat 4.0.1.  It's just not working
under Tomcat, which makes me think I have a class loader problem.
However, I've move the xercesImpl.jar file into the
webapps/<application>/WEB-INF/lib directory and can't get this to work.

take care - edwardJones
> I
think it should be "javax.xml.parsers.SAXParser"
>
> Ragu
> CircuitVision
>
>
>
> -----Original Message-----
> From: Dr. Edward R. Jones [mailto:ejones@falcon.tamucc.edu]
> Sent: Tuesday, July 09, 2002 10:18 AM
> To: xerces-j-user@xml.apache.org
> Subject: Xerces 2.01 + Tomcat 4.0.1 problem
>
>
> Hi, I've looked high and low for documentation on dynamic class loading
for
> tomcat 4.0.1.  Can't seem to find an answer to this problem.  I'm trying
to
> use Xerces-J 2.0.1 parser in a class using the tomcat.
>
> I receive the following message:
>
> Preparing to create XML Reader using Xerces Parser
> java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParser
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:130)
>         at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown
> Source)
>         at ValidatorService.validate(ValidatorService.java:60)
>
> etc...
>
> This came from the following java statement:
>
> XMLReader reader =
> XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
>
> Is this a Tomcat, Xerces or dumb user problem?
>
> thanks - edwardJones
> --
>
****************************************************************************
>  Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
>  Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840
>
****************************************************************************
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>

--
****************************************************************************
 Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
 Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840
****************************************************************************


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


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


RE: Xerces 2.01 + Tomcat 4.0.1 problem

Posted by "Dr. Edward R. Jones" <ej...@falcon.tamucc.edu>.
Hi Ragu,

Thanks for the reply, but javax.xml.parsers.SAXParser is the default jaxp
parser.  I'm trying to use the Xerces parser which is in
org.xml.xerces.parsers.SAXParser.  The java code mentioned below works
fine when I run the code outside tomcat 4.0.1.  It's just not working
under Tomcat, which makes me think I have a class loader problem.  
However, I've move the xercesImpl.jar file into the
webapps/<application>/WEB-INF/lib directory and can't get this to work.

take care - edwardJones
> I 
think it should be "javax.xml.parsers.SAXParser"
> 
> Ragu
> CircuitVision
> 
> 
> 
> -----Original Message-----
> From: Dr. Edward R. Jones [mailto:ejones@falcon.tamucc.edu]
> Sent: Tuesday, July 09, 2002 10:18 AM
> To: xerces-j-user@xml.apache.org
> Subject: Xerces 2.01 + Tomcat 4.0.1 problem
> 
> 
> Hi, I've looked high and low for documentation on dynamic class loading for
> tomcat 4.0.1.  Can't seem to find an answer to this problem.  I'm trying to
> use Xerces-J 2.0.1 parser in a class using the tomcat.
> 
> I receive the following message:
> 
> Preparing to create XML Reader using Xerces Parser
> java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParser
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:130)
>         at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown
> Source)
>         at ValidatorService.validate(ValidatorService.java:60)
> 
> etc...
> 
> This came from the following java statement:
> 
> XMLReader reader =
> XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
> 
> Is this a Tomcat, Xerces or dumb user problem?
> 
> thanks - edwardJones
> --
> ****************************************************************************
>  Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
>  Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840
> ****************************************************************************
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> 

-- 
****************************************************************************
 Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
 Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840 
****************************************************************************


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


RE: Xerces 2.01 + Tomcat 4.0.1 problem

Posted by Ragunath Marudhachalam <rm...@circuitvision.com>.
I think it should be "javax.xml.parsers.SAXParser"

Ragu
CircuitVision



-----Original Message-----
From: Dr. Edward R. Jones [mailto:ejones@falcon.tamucc.edu]
Sent: Tuesday, July 09, 2002 10:18 AM
To: xerces-j-user@xml.apache.org
Subject: Xerces 2.01 + Tomcat 4.0.1 problem


Hi, I've looked high and low for documentation on dynamic class loading for
tomcat 4.0.1.  Can't seem to find an answer to this problem.  I'm trying to
use Xerces-J 2.0.1 parser in a class using the tomcat.

I receive the following message:

Preparing to create XML Reader using Xerces Parser
java.lang.ClassNotFoundException: org/apache/xerces/parsers/SAXParser
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:130)
        at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown
Source)
        at ValidatorService.validate(ValidatorService.java:60)

etc...

This came from the following java statement:

XMLReader reader =
XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");

Is this a Tomcat, Xerces or dumb user problem?

thanks - edwardJones
--
****************************************************************************
 Edward R. Jones, Ph.D.            |  email:   ejones@falcon.tamucc.edu
 Texas A&M Univ. - Corpus Christi  |  phone:   (361) 825-5840
****************************************************************************



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


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