[jdom-interest] AbstractMethodError in DOMBuilder

tom wible airdrummer at wheel.org
Tue May 21 10:53:23 PDT 2002


howdy, all, i'm trying to retrofit jdom into an existing xml tree editor, written waybackwhen (jdom makes things _so_ much easier, but i don't really want to rewrite all that code;-)

what i want to do is save a piece of an existing DOM tree into a new file, using the org.w3c.dom.Element selectedNode (which has been hi-lited in the gui)

	    newTmplt = templateFileChooser.getSelectedFile();
		dbgmsg("saveElementAs", "newTmplt="+newTmplt);
	    try
	    {
 		FileWriter out = new FileWriter(newTmplt);
		org.jdom.output.XMLOutputter serializer
			 = new org.jdom.output.XMLOutputter("   ",true);
  		org.jdom.input.DOMBuilder db = new org.jdom.input.DOMBuilder(); 
		org.jdom.Element     element = db.build(selectedNode); <-line 468
  		serializer.output(element, out);
  		out.flush();
  		out.close();
	    }
       	    catch(Exception e)
	    {
		dbgmsg("saveElementAs", "ERROR: "+e);
	    }

which results in the following:

	%%%%%%DBG:saveElementAs:        newTmplt=/jasper/data/COVER/templates/Threat/cvrinh2.xml
	java.lang.AbstractMethodError: com.sun.xml.tree.ElementNode.getNamespaceURI()Ljava/lang/String;
        	at org.jdom.input.DOMBuilder.buildTree(DOMBuilder.java:403)
        	at org.jdom.input.DOMBuilder.build(DOMBuilder.java:362)
        	at com.trw.mdd.tamd.WBC.EditorFrame.saveElementAs(EditorFrame.java:468)

and as my exception handler doesn't see the a.m.error, it must be swallowed in buildTree...shouldn't it be propagated?

so is this my problem or jdom's?
adthanxvance
tom



More information about the jdom-interest mailing list