Search code examples
javaparsingclasscastexceptionxercesincompatibletypeerror

java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl incompatible with javax.xml.parsers.SAXParserFactory


Upon deploying my application to websphere, I am getting the below exception. Does this mean the versions are not supported with each other? I can post the full log if required!

java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl incompatible with javax.xml.parsers.SAXParserFactory

Note: I have seen the other post which is answered, but that is not helpful to me! Since I do not have enough reputation to comment there, I had to repost this!


Solution

  • This happened due to jar conflict between websphere default jars vs project library jars. Upon changing the class loader settings to PARENT_LAST in websphere console, I was able to resolve the issue.