Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error: System property org.xml.sax.driver not specified

843834Aug 24 2006
org.xml.sax.SAXException: System property org.xml.sax.driver not specified
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
at com.nit.admin.service.impl.appservice.DataReader.main

If you get such error, it means you are not using the SAXParser properly.

Proper Use:
===============================================
XMLReader tXR = null;
SAXParserFactory tSaxParserFact = SAXParserFactory.newInstance();
SAXParser tSAXParser = tSaxParserFact.newSAXParser();
tXR = tSAXParser.getXMLReader();
/*-------DataReader is our class which extends DefaultHadler
and overrides its methods */
DataReader tDataReader = new DataReader();
tXR.setContentHandler(tDataReader);
tXR.parse(new InputSource(new FileReader("Filename"));
===============================================

The error will be eliminated. It has been tried out.
cheers,
Prasad
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 21 2006
Added on Aug 24 2006
0 comments
281 views