更新应用程序上的ClasscastException

时间:2015-02-16 15:03:40

标签: java weblogic classloader weblogic12c xerces

我有一个在weblogic 12.1.2容器中运行的openjpa应用程序。

当我第一次安装应用程序时,一切正常。如果我更新ear文件(或重新部署),我会收到以下错误:

    - Could not log the error: EJB Exception:  found this error: EJB Exception: : <openjpa-1.1.1-SNAPSHOT-r422266:1445923 nonfatal general error> org.apache.openj
pa.persistence.PersistenceException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
        at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:196)
        at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:199)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:152)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
        at weblogic.persistence.TransactionalEntityManagerProxyImpl.newPersistenceContext(TransactionalEntityManagerProxyImpl.java:71)
        at weblogic.persistence.BasePersistenceContextProxyImpl.getPersistenceContext(BasePersistenceContextProxyImpl.java:175)
        at weblogic.persistence.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:106)
        at weblogic.persistence.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:82)
        at weblogic.persistence.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:92)
        at com.sun.proxy.$Proxy235.createNativeQuery(Unknown Source)
(...)
Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
        at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
        at org.apache.openjpa.lib.xml.XMLFactory.getDOMParser(XMLFactory.java:107)
        at org.apache.openjpa.jdbc.sql.SQLErrorCodeReader.parse(SQLErrorCodeReader.java:108)
        at org.apache.openjpa.jdbc.sql.DBDictionary.endConfiguration(DBDictionary.java:4096)
        at org.apache.openjpa.jdbc.sql.OracleDictionary.endConfiguration(OracleDictionary.java:170)
        at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:505)

这只能通过重新启动群集节点来解决。这在Weblogic 10.3中不会发生。

我一直在环顾四周,偶然发现了几个可能的解决方案无济于事。其中一个可能的问题可以在这里看到:Stackoverflow Question

从这里我开始摆弄耳朵,我现在在我的APP-INF / lib里面有xercesImpl lib(服务器上存在的那个)。没有这个,应用程序甚至不会安装。

我尝试将以下行添加到我的weblogic-application.xml中:

<wls:package-name>org.apache.xerces.*</wls:package-name>

这没有效果。

还调查了我的EntityManager在取消部署时被打开的可能性,但我没有理由相信这种情况。我的所有EntityManager都是使用@EJB注释进行容器管理和注入的。

有人对此有任何想法吗?

0 个答案:

没有答案