Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPA 2.0 and WebLogic 10
JPA 2.0 and WebLogic 10 [message #545224] Wed, 07 July 2010 09:06 Go to next message
Oliver Libutzki is currently offline Oliver LibutzkiFriend
Messages: 2
Registered: July 2010
Junior Member
Hi everyone,

I would like to run a JPA 2.0 application on a Oracle WebLogic 10.0.0 and 10.3 application server. Unfortunately WebLogic doesn't support JPA 2.0 so far. I did some adjustments in order to get my application running as mentioned in this great abstract.

I tried to configure my application this way: "DI 1.1: Alternative 3: Application Level Shared Library "

It doesn't work (stacktrace at the end of my post). So I deceded to use one of the ear-files provided by the ticket.

I've used this one: " Preliminary example EAR - application managed EM, container managed JTA DS, bootstrap EMF (option 3 of 6 - UC 1 of 4) - add eclipselink.jar to app-lib (5Mb)". I added the eclipselink.jar to the APP-INF/lib directory and installed this application.

The result is the same: I get a ClassCastException:
Caused By: weblogic.deployment.EnvironmentException: Error processing persistence unit example of module enterprise: Error instantiating the Persistence Provider class org.eclipse.persistence.jpa.PersistenceProvider of the PersistenceUnit example: java.lang.ClassCastException: org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to javax.persistence.spi.PersistenceProvider
	at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:344)
	at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:332)
	at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:134)
	at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:336)
	at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:111)
	at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:58)
	at weblogic.servlet.internal.WebAppModule.setupPersistenceUnitRegistry(WebAppModule.java:1812)
	at weblogic.servlet.internal.WebAppModule.getWebClassLoader(WebAppModule.java:1604)
	at weblogic.servlet.internal.WebAppServletContext.initClassLoader(WebAppServletContext.java:2969)
	at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:438)
	at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:484)
	at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
	at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:976)
	at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:381)
	at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
	at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
	at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:507)
	at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
	at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
	at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
	at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:1221)
	at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
	at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:367)
	at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:58)
	at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
	at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
	at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
	at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
	at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
	at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
	at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
	at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
	at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
	at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
	at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
	at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
	at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
	at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)


Using Google it looks like many developers hit on this problem, as there seems to be a conflict between JAP 1 and JPA 2.0.

Thanks for your help.

Kind regards
Oliver
Re: JPA 2.0 and WebLogic 10 [message #545636 is a reply to message #545224] Thu, 08 July 2010 13:32 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

What aspects of JPA 2.0 are you trying to use?

If it is just the new annotations/mappings these will work with EclipseLink in JPA 1.0 as well.

If you wish to use the JPA 2.0 EntityManager API, the easiest way, I think is to just replace the JPA 1.0 jar in WLS with the 2.0 jar.

Are you using a managed or non-managed EntityManager?


James : Wiki : Book : Blog : Twitter
Previous Topic:Foreign key to unique field not primary key problem
Next Topic:oracle database trigger and INSERT problem
Goto Forum:
  


Current Time: Wed Nov 26 04:35:00 GMT 2014

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

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