How to enable Weblogic 12.1.2 JPA 2.1

I am deploying our web application on a Weblogic server. However, although I was able to successfully deploy the application in this new version, the application does not start, and users cannot log in. Magazine:

May 29, 2015 4:38:47 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)

I believe this is happening because Weblogic allows JPA 2.0 by default (but I'm not sure about that). Is there a way to enable JPA 2.1?

PS: We use hibernate 4.3.8, and I am not an expert on application servers.

Sincerely.

+4
source share
1 answer

12.1.3, JPA 2.1 , , . , , common/bin/commEnv.sh

PRE_CLASSPATH=$MW_HOME/oracle_common/modules/javax.persistence_2.1.jar:$MW_HOME/wlserver/modules/com.oracle.weblogic.jpa21support_1.0.0.0_2-1.jar
export PRE_CLASSPATH
+5

All Articles