ClassCastException while parsing XML with WebLogic

rose picture rose · Feb 7, 2011 · Viewed 36k times · Source

I'm getting the following error message:

java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory cannot be cast to javax.xml.parsers.DocumentBuilderFactory

I've gone through some forums researching this. They said to remove xml-apis.jar or that JAR files were conflicting. But even though I did all the suggested steps, I'm getting the same error.

Answer

mhaller picture mhaller · Feb 7, 2011

It's always the xml-apis.jar. Remove them from your classpath (e.g. remove them from WEB-INF/lib of your webapp).