Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Can not deploy 3.5 to Weblogic 10.3 server
PostPosted: Mon Mar 22, 2010 6:54 pm 
Newbie

Joined: Mon Mar 22, 2010 6:37 pm
Posts: 2
I am trying to deploy my project that I upgraded to Hibernate 3.5 but keep on getting the following error:

java.lang.Throwable: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:580)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:330)
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)
at weblogic.servlet.internal.WebAppModule.setupPersistenceUnitRegistry(WebAppModule.java:1658)
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:383)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)


I am utilizing Hibernate 3.5, JPA 2.0 and Spring 3.0.1 within this project. IntelliJ Idea 9.0.x as my IDE and Weblogic 10.3.0 as my application server. I create a web application via a war file (no ear).

Please note that my junit tests that I run locally work fine. I used to get this error on the junit test (locally) until I put the WL 10.3.0 jar after my project lib jars in the dependencies. I figured that the same issue must be happening with the deploy (that the WL 10.3.0 packaged JPA support is being hit first before the newer versions of Hibernate/JPA), so went into my weblogic.xml file verified that I had the <prefer-web-inf-classes> is set to true and that I did have the needed jars included in the war (hibernate-jpa-2.0-api-1.0.0-CR-1.jar, hibernate3.jar, etc...).

Any help would be appreciated. Is there a setting or step that I am missing when deploying?

Thank you


Top
 Profile  
 
 Post subject: Re: Can not deploy 3.5 to Weblogic 10.3 server
PostPosted: Tue Apr 06, 2010 2:40 pm 
Newbie

Joined: Tue Apr 06, 2010 2:11 pm
Posts: 2
I had the same problem, and I believe you are right about weblogic having it's own version of the JPA interfaces javax.persistence.*
I also tried forcing weblogic to use the newer version deployed within my application by adding the package in weblogic-application.xml :

Code:
<weblogic-application>
    <prefer-application-packages>
   <package-name>javax.persistence.*</package-name>
    </prefer-application-packages>
</weblogic-application>


By doing this I don't get the exception you mention anymore, but now I got a different one:

weblogic.management.DeploymentException:
at weblogic.application.internal.flow.JpaFlow.prepare(JpaFlow.java:59)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16)
Truncated. see log file for complete stacktrace
weblogic.deployment.EnvironmentException: Error processing persitence unit ApplicationEntityManager of module midas-ear-
1: Error instantiating the Persistence Provider class org.hibernate.ejb.HibernatePersistence of the PersistenceUnit Appl
icationEntityManager: java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persi
stence.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(AbstractPersistenceUnitRegistr
y.java:111)
at weblogic.deployment.EarPersistenceUnitRegistry.<init>(EarPersistenceUnitRegistry.java:52)

I think the issue is that weblogic is not ready to fully support JPA 2.0


Top
 Profile  
 
 Post subject: Re: Can not deploy 3.5 to Weblogic 10.3 server
PostPosted: Tue Jun 08, 2010 2:12 am 
Newbie

Joined: Tue Jun 08, 2010 1:29 am
Posts: 2
We are getting exactly same error, and are stuck with this for past couple of days. It is kind of urgent. If you were able to resolve this, please share the pointers...


Top
 Profile  
 
 Post subject: Re: Can not deploy 3.5 to Weblogic 10.3 server
PostPosted: Tue Jun 08, 2010 1:28 pm 
Newbie

Joined: Mon Mar 22, 2010 6:37 pm
Posts: 2
No progress yet. I even tried the same process with the new Hibernate (3.5.2) and the new Spring (3.0.2) and the same issue happens.


Top
 Profile  
 
 Post subject: Re: Can not deploy 3.5 to Weblogic 10.3 server
PostPosted: Wed Oct 20, 2010 12:51 pm 
Newbie

Joined: Wed Oct 20, 2010 12:48 pm
Posts: 2
I am also facing the same problem. Has anyone found a solution for this?


Top
 Profile  
 
 Post subject: Re: Can not deploy 3.5 to Weblogic 10.3 server
PostPosted: Tue Feb 15, 2011 1:45 am 
Beginner
Beginner

Joined: Thu May 05, 2005 4:49 pm
Posts: 30
Any updates on this problem?


Top
 Profile  
 
 Post subject: Re: Can not deploy 3.5 to Weblogic 10.3 server
PostPosted: Fri Feb 25, 2011 10:40 am 
Newbie

Joined: Fri Feb 25, 2011 10:34 am
Posts: 1
I applied the PRE_CLASSPATH solution in my development environment and the EAR solution in production:

http://wiki.eclipse.org/EclipseLink/Dev ... A2_support

It's for EclipseLink but it works for Hibernate too.

I found that link in this forum: http://wiki.eclipse.org/EclipseLink/Dev ... A2_support


Top
 Profile  
 
 Post subject: Re: Can not deploy 3.5 to Weblogic 10.3 server
PostPosted: Mon Oct 08, 2012 7:32 am 
Newbie

Joined: Wed Sep 22, 2010 5:35 am
Posts: 2
Hi,

I am using Weblogic version 10.3.5.0 and facing the same issue when using JPA 2.0 with Hibernate Provider.

Can anyone please suggest what is possible solution to this issue?

Thanks,
Gourav Sood


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.