On 2/26/07, Mike O'Leary <[EMAIL PROTECTED]> wrote:

 This file is in JDK 1.5 in the package
com.sun.org.apache.xerces.internal.jaxp, but it is defined in a jar file
called rt.jar. I downloaded a copy of Xerces-J-tools.2.9.0 and added
xercesImpl.jar to my classpath. Now when I get to the setFeature function
call, I get an error that says

Exception in thread "main" java.lang.AbstractMethodError:
javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V

It does look like the version of DocumentBuilderFactoryImpl does not
contain a definition for setFeature and DcoumentBuilderFactory is an
abstract class, so I guess this all makes sense. Did you encounter things
like this when you were setting things up?

I didn't. I didn't realize at the time that I was getting lucky. =)

For me, the following code:

final static String DOCUMENT_CLASS_ID = "
http://apache.org/xml/properties/dom/document-class-name";;
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
log.debug("Document Class: " + dbFactory.getAttribute(DOCUMENT_CLASS_ID));

Prints:

Document Class: org.apache.xerces.dom.DocumentImpl

The system property javax.xml.parsers.DocumentBuilderFactory is not set.
What I have that compiles and runs. It's very alpha, but it does compile and
work for me.

http://odin.himinbi.org/jars/src/org/himinbi/templ/
http://odin.himinbi.org/templ/build.xml

If you're really stuck and want to try and run it, the hierarchy should look
like:

/build.xml
/src/org/himinbi/templ/
/lib/

Where /lib/ contains the jars from the most recent releases of log4j and
xerces.

Will

Reply via email to