Title: JAXP via reflection????
----- Original Message -----
Sent: Tuesday, July 02, 2002 2:55 PM
Subject: RE: [dom4j-dev] JAXP via reflection????

On my system (SunOS 5.6) there is no directory under META-INF.
 
I have set org.dom4j.verbose as in following code:
 
public static void main(String argv[]) {
        try {
         URL fileURL = new File("report.xml").toURL();
 
         System.setProperty("org.dom4j.verbose","true");
   
         SAXReader reader = new SAXReader();
          
         Document doc = reader.read(fileURL);
 
         System.out.print(doc.asXML()) ;
 
        } catch (Exception e) {
          e.printStackTrace(System.err);
        }
    }
 
With the above code, I am getting following warnings: (In both cases: when I used only xmlParserAPIs.jar and jaxp.jar with xerces.jar)
 
Warning: Caught exception attempting to use JAXP to load a SAX XMLReader
Warning: Exception was: java.lang.NoSuchMethodError: javax.xml.parsers.SAXParser
: method getXMLReader()Lorg/xml/sax/XMLReader; not found
Warning: I will print the stack trace then carry on using the default SAX parser
java.lang.NoSuchMethodError: javax.xml.parsers.SAXParser: method getXMLReader()Lorg/xml/sax/XMLReader; not found
 
 
The getXMLReader() method which returns an XMLReader has been part of the javax.xml.parsers.SAXParser interface since JAXP 1.1. So if you're getting this exception, it must be that you have a JAXP 1.0 jar on your classpath in front of any JAXP 1.1 distribution.
 
James

Reply via email to