Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JPA2 Provider as Hibernate in Weblogic 12.1

shatkJan 8 2014

I am getting below exception when we try to deploy our application with JPA2 Provider as Hibernate in weblogic 12.1

Caused By: java.lang.ClassCastException: org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to javax.persistence.spi.PersistenceProvider

        at javax.persistence.Persistence$1.isLoaded(Persistence.java:92)

        at org.hibernate.validator.internal.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:57)

I have below entries in weblogic.xml :

<prefer-application-packages>

            <package-name>org.hibernate.*</package-name>

            <package-name>javax.persistence.*</package-name>

        </prefer-application-packages>

and below pre class path setting in weblogic server commEnv.cmd (common/bin).

     set PRE_CLASSPATH=%MW_HOME%\modules\javax.persistence_2.0.0.0_2-0.jar;

Application worked fine in weblogic 11g with below pre class path setting.

        PRE_CLASSPATH="/apps/Oracle/Middleware/modules/javax.persistence_1.0.0.0_2-0-0.jar:/apps/Oracle/Middleware/modules/com.oracle.jpa2support_1.0.0.0_2-0.jar"


There was as addition jar com.oracle.jpa2support_1.0.0.0_2-0.jar. This jar is missing in weblogic 12.1 modules directory.

Could anyone suggest how to resolve the persistence provider conflict issue in weblogic 12.1 ?


Hibernate Jar Versions : hibernate-core-4.2.0.Final.jar, hibernate-jpa-2.0-api-1.0.1.Final.jar, hibernate-validator-4.3.1.Final.jar




Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 5 2014
Added on Jan 8 2014
0 comments
2,747 views