Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problems with SAX parser in Java (SAX2 driver class javax.xml.parsers.SAXParser found but cannot be loaded)

Reply
Thread Tools

Problems with SAX parser in Java (SAX2 driver class javax.xml.parsers.SAXParser found but cannot be loaded)

 
 
Per Magnus L?vold
Guest
Posts: n/a
 
      11-16-2004
Hi!
I am new to XML parsing, and I'm trying to parse an XML file which is
passed as a BufferedReader object.
I have followed the steps described in a Javaworld article
(http://www.javaworld.com/javaworld/j...-0804-sax.html) which
seems quite simple. I've also downloaded the latest Web Services
Developer Pack, installed it, and added the jar-file to the classpath
in JDeveloper.

After programming the parser class, I get an error message which I
can't figure out of:
"Unexpected error: SAX2 driver class javax.xml.parsers.SAXParser found
but cannot be loaded"

Why can't it be loaded? Any ideas?

Here is a sample of my code:

/*
* this is the class that calls the XML parser (myXMLParser)
* I beleive the error must lie here somewhere, or perhaps in the
configuration?
*/
myXMLParser test = new myXMLParser();
String parserclass =
System.getProperty("org.xml.sax.driver","javax.xml .parsers.SAXParser");
/*
* I beleive the error comes on this next line. 'parserclass' is
* identified as "javax.xml.parsers.SAXParser", which is found but
cannot
* be loaded? What could be wrong? It is added to the classpath.
*/
XMLReader xr = XMLReaderFactory.createXMLReader(parserclass);
xr.setContentHandler(test);
// 'br' (below) is the BufferedReader object of an XML file
xr.parse(new InputSource(br));

Regards, PML
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to force SAX parser to ignore encoding problems Ɓukasz Python 2 08-07-2009 06:40 AM
org.xml.sax.driver permission problems jwarzech@gmail.com Java 0 06-18-2007 04:52 PM
SAX parser: problems with overwritten characters method leo Java 1 04-13-2005 02:26 PM
NullPointer Exception in class SAX2DTM during FOP generation with SAX Parser Jens Mueller Java 0 04-12-2005 04:28 PM



Advertisments