0

I have an openjpa application running in a weblogic 12.1.2 container.

When i first install the application everything works fine. If i update the ear file (or redeploy) i get the following error:

    - 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)

This is only fixed by restarting the cluster nodes. This doesn't happen in Weblogic 10.3.

I've been looking around and i stumbled across several possible solutions to no avail. One of the possible issues can be seen here: Stackoverflow Question

From here I started fiddling with the ear and i now have the xercesImpl lib ( the same that exists on the server) inside my APP-INF/lib this. Without this the application won't even install.

I've tried adding the following line to my weblogic-application.xml:

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

And this had no effect.

Also looked into the possibility that my EntityManager was being left open upon undeploy, but i have no reason to believe this is the case. All my EntityManager are container managed and injected using the @EJB annotation.

Anyone have any ideas on this?

Wojciech Wirzbicki
  • 3,887
  • 6
  • 36
  • 59
Nuno Furtado
  • 4,548
  • 8
  • 37
  • 57
  • Are you doing a Stop -> Delete -> Install or trying to hot deploy over a running app? – Display Name is missing Feb 16 '15 at 18:25
  • @DisplayNameismissing i'm using the weblogic console to either update the ear package or simply delete and reinstall. happens both instances. These two options are the regular usage for weblogic. – Nuno Furtado Feb 17 '15 at 07:23
  • It seems like a `delete -> activate` followed by an `install -> activate` should always work. Otherwise maybe it's a cached classpath or something like: http://stackoverflow.com/questions/1868724/java-lang-classcastexception-org-apache-xerces-parsers-xincludeawareparserconfi – Display Name is missing Feb 17 '15 at 16:11
  • @DisplayNameismissing It doesn't seem to be cached or bad classpath. I revamped the jar files in the ear and removed all but one jar. This xerces jar is the same that weblogic has in it's modules folder, i can't remove or the application will not install – Nuno Furtado Feb 24 '15 at 15:33

0 Answers0