Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

javax.xml.parsers.FactoryConfigurationError

843834Sep 30 2002 — edited Oct 6 2002
Hi, Everybody,
I am facing problem, Whenever I tried to read XML file I found following Error.
"javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.DocumentBuilderFactory cannot be found
at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
at Pricing.mapDoc(Pricing.java:39)
at Pricing.main(Pricing.java:84)"

My function code is as follows:

public void mapDoc()
{
Document mapDoc = null;
try {
//Create the DocumentBuilderFactory
DocumentBuilderFactory dbfactory
= DocumentBuilderFactory.newInstance();
System.out.println("Document factory--->"+ dbfactory);
//Create the DocumentBuilder
DocumentBuilder docbuilder = dbfactory.newDocumentBuilder();
//Parse the file to create the Document
mapDoc = docbuilder.parse("mapping.xml"); Element mapRoot = mapDoc.getDocumentElement();
//Retrieve the (only) data element and cast it to Element
Node dataNode = mapRoot.getElementsByTagName("data").item(0);
Element dataElement = (Element)dataNode;
String sql = dataElement.getAttribute("sql");
System.out.println(sql);
} catch (Exception e) {
System.out.println("Problem creating document: "
+e.getMessage ());
}

}

I will be thankfull, if someone helps.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 3 2002
Added on Sep 30 2002
8 comments
808 views