I am writing a plugin and I need to do some XML parsing. Since I am writing a wrapper around an existing library I tried to use their classes (already written) to do so.
They use dom4j (not jdom) and I keep getting a problem when loading the SAXParser. The following line runs fine if I run it through a main function but fails when I run the plugin from the sandbox:
XMLReader xmlReader = XMLReaderFactory.createXMLReader();
SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement XMLReader
I guess this is because it is loadig the SAXParser from the JDK or an Intellij lib directory and not the one I have on my classpath (version 2.6.2). Is there any way to overcome this issue? Or am I forced to use to rewrite the parsing using JDOM?
I tried looking at the Version class through a debugger and it reports the correct version so I am not sure where it is getting the SAXParser from??
Any help would be much appreciated...