Hello,
I just downloaded Xerces 2.2.1 from the website and attempted to build a very very simple project but when I go to run it, I get the following error:
java.lang.LinkageError: loader constraints violated when linking org/w3c/dom/Document class
The only two jars in my classpath are:
xmlParserAPIs.jar
and
xercesImpl.jar
I am using the 1.3.1_05 JDK.
Code:
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;
...
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new File(m_filename));
System.out.println ( "First node: " + doc.getFirstChild().getNodeName() );
} catch (FactoryConfigurationError error) {
error.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Any suggestions on why I am getting this linkage error? I am at a complete loss at how to fix this.
-Ryan
