简体   繁体   English

如何启用Weblogic 12.1.2 JPA 2.1

[英]How to enable Weblogic 12.1.2 JPA 2.1

I have been deploying our web application to Weblogic server. 我一直在将Web应用程序部署到Weblogic服务器。 However, although I was able to deploy the application successfully in this new version, the app does not start up and users cannot login. 但是,虽然我能够在此新版本中成功部署应用程序,但应用程序无法启动,用户无法登录。 The log is: 日志是:

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 happens because Weblogic enables JPA 2.0 by default (but I am not sure of it). 我相信这是因为Weblogic默认启用JPA 2.0(但我不确定)。 Is there a way to enable JPA 2.1? 有没有办法启用JPA 2.1?

PS: We are using hibernate 4.3.8 and I am not an expert on application servers. PS:我们正在使用hibernate 4.3.8,而且我不是应用服务器方面的专家。

Regards. 问候。

If you can upgrade to 12.1.3 then JPA 2.1 support is included but disabled by default, you can follow their instructions for enabling it . 如果您可以升级到12.1.3,则包含JPA 2.1支持但默认情况下已禁用,您可以按照其说明启用它 It amounts to putting the right jars on the classpath which you can do by adding this to the top of common/bin/commEnv.sh 这相当于将正确的jar放在classpath上,你可以将它添加到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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM