ClassCastException of persistence.xml

java.lang.ClassCastException: : org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration" occurred while attempting to determine the version of "zip:C:/JDeveloper/11.1.1.4.0/user_projects/domains/.../persistence.xml".

The problem maybe caused by the encoding of the persistence.xml.

Another possible reason is caused by the classloading of the xercesImpl.jar. Qwblogic has built-in xercesImpl.jar, your application should load the jar from parent classloader. However,  using org.apache.xerces.* in weblogic-application.xml may cause classloading problem. 


Solution:
Remove the prefer settings from weblogic-application.xml - not exactly work
or
exclude this jar from POM.xml. - work


留言

這個網誌中的熱門文章

java.lang.NoClassDefFoundError: org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl$Parser

10 Tips for Proper Application Logging

Turn off WebLogic basic authentication