This discussion is archived
4 Replies Latest reply: Aug 27, 2010 11:32 AM by 843790 RSS

DocumentBuilderFactory.newInstance().newDocumentBuilder() error

843790 Newbie
Currently Being Moderated
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.*;
public class FrameRecorder extends Thread {
     public Document dmt;
     public FrameRecorder() {
          DocumentBuilderFactory fctry = DocumentBuilderFactory.newInstance();
//the error is on the next line.
          DocumentBuilder bldr = fctry.newDocumentBuilder();

When I run it, I get an error saying:

Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problem:
     Unhandled exception type ParserConfigurationException

     at FrameRecorder.<init>(
     at BaseFrame.<init>(
     at Base.createGUI(
     at Base$
     at java.awt.event.InvocationEvent.dispatch(
     at java.awt.EventQueue.dispatchEvent(
     at java.awt.EventDispatchThread.pumpOneEventForFilters(
     at java.awt.EventDispatchThread.pumpEventsForFilter(
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(
     at java.awt.EventDispatchThread.pumpEvents(
     at java.awt.EventDispatchThread.pumpEvents(

I don't know what to do to fix this.
I'm running 64-bit Ubuntu 10.4 so could it be a compatibility problem? The only headway I could make was that .newDocumentBuilder() throws a ParserConfigurationException (that's the error I'm getting), and the docs tell me that .newDocumentBuilder() throws this when it "DocumentBuilder cannot be created which satisfies the configuration requested".

Any help?