SV: [jdom-interest] DOMBuilder problem

Per Norrman pernorrman at telia.com
Fri Oct 10 00:43:04 PDT 2003


Hi,
 
do you have a specific reason for using DOMBuilder? Otherwise, you're
better of using SAXBuilder.
 
/pmn
-----Ursprungligt meddelande-----
Från: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org] För
Gina Pan
Skickat: den 10 oktober 2003 00:43
Till: jdom-interest at jdom.org
Ämne: [jdom-interest] DOMBuilder problem


Hi,
 
I am trying to use DOMBuilder to read an XML file to a DOM tree but it gives
me an error as shown below:
 
org.jdom.JDOMException: Error in building from stream: Class
org.jdom.input.DOMBuilder can not access a member of class
gnu.xml.dom.JAXPFactory$JAXPBuilder with modifiers "public"
      at org.jdom.input.DOMBuilder.build(DOMBuilder.java:298)
      at nz.co.mortgagechoice.MCSession.loadFromXML(MCSession.java:207)
      at nz.co.mortgagechoice.MCSession.<init>(MCSession.java:185)
      at nz.co.mortgagechoice.ui.MCContext.<init>(MCContext.java:46)
      at
nz.co.mortgagechoice.ui.MortgageChoiceApplication.<init>(MortgageChoiceAppli
cation.java:19)
      at
nz.co.mortgagechoice.ui.MortgageChoiceApplication.main(MortgageChoiceApplica
tion.java:52)
 
****************************************
Here is my code which causes the problem:
 
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;
 
public void loadFromXML () throws Exception {
    Document document = null;
    Element element = null;
 
    InputStream stream = getClass().getResourceAsStream ("/config.xml");
    if (stream == null){
      return;
    }
 
    DOMBuilder builder = new DOMBuilder ();
    document = builder.build (stream);
 
    if ((document == null)
     || (document.getRootElement() == null)
     || (!document.getRootElement().getName().equals("config")))
      throw new Exception("invalid document");
     .....
     .....
 
}
 
 
Could anybody please help me?  
 
Many thanks,
 
Gina
 
 
 
DISCLAIMER: The content of this email is confidential and may contain
legally privileged information intended only for the individual or entity
named above.  Access to this message by anyone else is unauthorised.  If you
are not the intended recipient, please be advised that the use, distribution
and publication of the above information is prohibited. If you have received
this email in error, please contact us by returning the email and destroying
the original. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20031010/97a5e105/attachment.htm


More information about the jdom-interest mailing list