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

眉间皱痕 提交于 2019-12-05 08:21:42

Basically, there is no need to package libraries that implement standardized APIs (like javax.xml) as most of them are already provided either by JRE or application server. This allows for avoiding various incompatibility issues like the one that you face.

If you still need to use a specific version of Xerces, change classloading policy of the web module to PARENT_LAST. In this case the library will be picked up from WEB-INF/lib. This does not guarantee you won't have problems though.

To sum it up: remove xercesImpl-2.8.1.jar from the application. Your operating environment provides XML parser implementation. In most cases you don't need to know which one.

I solved it changing the association of the shared libraries.

Originally the xerces libraries were included as a shared library under application level, so these libraries were loaded before than the application server.

I changed the shared library association to module level, now these libraries are loaded after than the application server and the exception dissappeared.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!