如何启用Weblogic 12.1.2 JPA 2.1 [英] How to enable Weblogic 12.1.2 JPA 2.1

查看:278
本文介绍了如何启用Weblogic 12.1.2 JPA 2.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在将我们的Web应用程序部署到Weblogic服务器.但是,尽管我可以在此新版本中成功部署该应用程序,但该应用程序无法启动,并且用户无法登录.日志是:

I have been deploying our web application to Weblogic server. 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)

我相信这是因为Weblogic默认启用JPA 2.0(但我不确定).有没有启用JPA 2.1的方法?

I believe this happens because Weblogic enables JPA 2.0 by default (but I am not sure of it). Is there a way to enable JPA 2.1?

PS:我们正在使用hibernate 4.3.8,我不是应用程序服务器方面的专家.

PS: We are using hibernate 4.3.8 and I am not an expert on application servers.

致谢.

推荐答案

如果可以升级到12.1.3,则包含JPA 2.1支持,但默认情况下已禁用,您可以遵循

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. 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

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

这篇关于如何启用Weblogic 12.1.2 JPA 2.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆