Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » deploy .ear w/ JPA 2.0 provider=EclispeLink to WLS 10.3.1
deploy .ear w/ JPA 2.0 provider=EclispeLink to WLS 10.3.1 [message #692428] Mon, 04 July 2011 08:24 Go to next message
Eclipse UserFriend
Hi,

We want to deploy a new app .ear to a WLS 10.3.1 instance with JPA 2.0 provider=eclispeLink (so that it can use the new javax.persistence.metamodel package API). We want to do this in a way that assures that the new app .ear deployment in no way impacts any other app .ear deployment using JPA 1.0 on that same WLS 10.3.1 instance.

We have basically covered all the steps documented under "alternative 3" on the EclipseLink wiki page addressing this issue (see wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#20110115:_JPA_2.0_using_EclipseLink_on_WebLogic_10.3.4.0 )

Because we could not get past the verison=2.0 XSD validation issue on deployment, our app's persistence.xml use the <persistence version=1.0 ...> header and comments out all the tags (i.e. <SHARED-CACHE-MODE/>) only available in the 2.0 XSD.



Our provider tag looks like this

<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

and our properties tag looks like this:

<properties>
<property name="eclipselink.target-server" value="WebLogic_10"/>
<property name="eclipselink.logging.level.sql" value="FINER"/>
<property name="eclipselink.cache.shared.default" value="false"/>
<property name="eclipselink.logging.logger" value="DefaultLogger"/>
</properties>


Following other recommended steps from the EclipseLink wiki, our .ear root has an APP-INF/ structure that looks like this

./APP-INF/lib/eclipselink.jar
./APP-INF/lib/javax.persistence_2.0.3.v201010191057.jar


Our .earRoot/META-INF/weblogic-application.xml file includes

<wls:prefer-application-packages>
<wls:package-name>javax.persistence.*</wls:package-name>
<wls:package-name>org.eclipse.persistence.*</wls:package-name>
</wls:prefer-application-packages>


Our .earRoot/META-INF/MANIFEST.MF file looks like this

Manifest-Version: 1.0
Class-Path: javax.persistence_2.0.3.v201010191057.jar eclipselink.jar

Our .earRoot/.warRoot/WEB-INF/weblogic.xml includes

<wls:container-descriptor>
<wls:prefer-web-inf-classes>*true*</wls:prefer-web-inf-classes>
</wls:container-descriptor>


Believing that we have covered all the recommened steps documented under "alternative 3" at the above cited EclipseLink wiki, we deploy this new app .ear to the WLS 10.3.1 instance and encounter the following Exception:

weblogic.deployment.EnvironmentException: Error processing persitence unit ReleaseBObjectModel of module /IConWorkspace: Error instantiating the Persistence Provider class org.eclipse.persistence.jpa.PersistenceProvider of the PersistenceUnit ReleaseBObjectModel: java.lang.ClassCastException: org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to javax.persistence.spi.PersistenceProvider
at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:322)
at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:123)
at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:331)
at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:111)
at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:58)
Truncated. see log file for complete stacktrace


Any ideas on what we need to do to overcome this CCE? Is our deployment both sound and complete wrt to our providing the necessary .earRoot/APP-INF/lib/ JPA 2.0 standard interface and eclipseLink implementation .jars?

We are a bit stuck.

We understand all the issues wrt WLS 10.3.1 being a particularly challenging JEE 5 platform on which to coerce JEE 6 capability (like JPA 2.0) ... we realize that this effoprt would be easier on WLS 10.3.4.

However, at this time, WLS 10.3.1 is the only platform on which we are allowed to attempt to deploy this application.

Thanks,
Ben.Cotton@csg.com
Re: deploy .ear w/ JPA 2.0 provider=EclispeLink to WLS 10.3.1 [message #692490 is a reply to message #692428] Mon, 04 July 2011 10:48 Go to previous message
Eclipse UserFriend
Ben,
Unfortunately, prior to WebLogic 10.3.4 you only have application managed persistence available for JPA 2.0. My page below details what can be done for older versions of WebLogic.

http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial#Oracle_WebLogic_Server_10.3.1.0
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic

The issue with injection/instrumentation/proxying of a container managed JPA 2.0 @PersistenceContext is that the DI code in WebLogic needs to be aware of the JPA 2.0 EM and EMF (the 10.3.1 API was not forward compatible - you would need to hack the Spring based AOP injection code and the referenced EMFProxyImpl areas - and partiallly upgrade in effect to 10.3.4).
See the following patch to the 20110115 initial release for the code changes related to (XSD, weaving and injection)
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#DI_1.1:_Alternative_3:_Application_Level_Shared_Library_-_In_Use
http://download.oracle.com/docs/cd/E17904_01/web.1111/e13720/using_toplink.htm#EJBAD1309

Note: if you don't require the JPA 2.0 additions to the persistence schema like shared-cache-mode NONE then use the 1.0 xsd to avoid the parse error.

thank you
Michael O'Brien
michael.f.obrien at eclipselink.org
http://www.eclipselink.org


cross references
http://forums.oracle.com/forums/thread.jspa?threadID=1093616&tstart=0
http://forums.oracle.com/forums/thread.jspa?threadID=2247518&tstart=0
http://www.eclipse.org/forums/index.php/m/692428/#msg_692428
Previous Topic: Translating PersistenceException to DataAccessException with EclipseLinkJpaDialect
Next Topic:(no subject)
Goto Forum:
  


Current Time: Thu Jul 03 17:18:26 EDT 2025

Powered by FUDForum. Page generated in 0.07107 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top