如何为 Weblogic 10.3.6 启用 Java Persistence 2.0
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22413068/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to Enable Java Persistence 2.0 for Weblogic 10.3.6
提问by hthomos
I am using eclipse with weblogic server. In order to add the project to the weblogic server, it needs to support Java Persistance 2.0, however when trying to install it, I keep getting this message
我在 weblogic 服务器上使用 eclipse。为了将项目添加到 weblogic 服务器,它需要支持 Java Persistance 2.0,但是在尝试安装它时,我不断收到此消息
Error Enabling Java Persistence 2.0 in Weblogic Server installation
在 Weblogic Server 安装中启用 Java Persistence 2.0 时出错
I tried to follow the Oracle documents to solve this but they make no sense since I'm pretty novice with Weblogic.
我试图按照 Oracle 文档来解决这个问题,但它们毫无意义,因为我对 Weblogic 还是个新手。
http://docs.oracle.com/cd/E17904_01/web.1111/e13720/using_toplink.htm#CIHDJHHI
http://docs.oracle.com/cd/E17904_01/web.1111/e13720/using_toplink.htm#CIHDJHHI
Please help! I understand the second part of the manual but I have no idea how to configure this Top Link stuff. Any help is greatly appreciated. Thank you!
请帮忙!我理解手册的第二部分,但我不知道如何配置这个 Top Link 的东西。任何帮助是极大的赞赏。谢谢!
采纳答案by David Hunt
I have enabled JPA 2.0 on a Unix-based system using a variation on the 'Installing Manually' steps in the Oracle doc you referenced. The key is to add the two JPA jars at the beginning of the classpath. In my case, we wanted JPA 2.0 support for a single managed server in the domain, so I added the following hack at the beginning of the setDomainEnv.sh script:
我使用您引用的 Oracle 文档中“手动安装”步骤的变体在基于 Unix 的系统上启用了 JPA 2.0。关键是在classpath的开头添加两个JPA jar。就我而言,我们希望 JPA 2.0 支持域中的单个托管服务器,因此我在 setDomainEnv.sh 脚本的开头添加了以下 hack:
if [ "${SERVER_NAME}" = "TEST_Server1" ] ; then
JPA20="path/modules/javax.persistence_1.1.0.0_2-0.jar${CLASSPATHSEP}path/modules/com.oracle.jpa2support_1.0.0.0_2-1.jar"
if [ "${PRE_CLASSPATH}" != "" ] ; then
PRE_CLASSPATH="${JPA20}${CLASSPATHSEP}${PRE_CLASSPATH}"
export PRE_CLASSPATH
else
PRE_CLASSPATH="${JPA20}"
export PRE_CLASSPATH
fi
fi
Adjust the TEST_Server1
name (or just remove the if) and path
references to align with your environment.
调整TEST_Server1
名称(或仅删除 if)和path
引用以与您的环境保持一致。
回答by Drew
I ended up using the 'Smart Update' utility that was located in: start->program files->Oracle WebLogic->Smart Update (Windows server, obviously)
我最终使用了位于以下位置的“智能更新”实用程序:开始->程序文件->Oracle WebLogic->智能更新(显然是 Windows 服务器)
The hardest part was locating the Oracle patch number for JPA 2 for my version of WebLogic (10.3.6).
最难的部分是为我的 WebLogic (10.3.6) 版本找到 JPA 2 的 Oracle 补丁号。
For those of you in the same boat this is the info for the patch for version 10.3.6:
对于那些在同一条船上的人,这是 10.3.6 版补丁的信息:
Smart Update patch 7BWI for WebLogic Server 10.3.6
适用于 WebLogic Server 10.3.6 的智能更新补丁 7BWI
Content:
内容:
This patch contains Smart Update patch 7BWI for WebLogic Server 10.3.6.0
此补丁包含适用于 WebLogic Server 10.3.6.0 的 Smart Update 补丁 7BWI
Description:
描述:
Enable JPA2.0 support on Weblogic server.
在 Weblogic 服务器上启用 JPA2.0 支持。
Patch Installation Instructions:
补丁安装说明:
- copy content of this zip file with the exception of README file to your SmartUpdate cache directory (MW_HOME/utils/bsu/cache_dir by default)
- apply patch using Smart Update utility
- 将此 zip 文件的内容(自述文件除外)复制到您的 SmartUpdate 缓存目录(默认为 MW_HOME/utils/bsu/cache_dir)
- 使用智能更新实用程序应用补丁
I am not sure how to attach files to this post or I would just include the patch. Message me if you want me to email a copy to you.
我不知道如何将文件附加到这篇文章,或者我只会包含补丁。如果您希望我通过电子邮件将副本发送给您,请给我留言。
回答by Hans Beemsterboer
Probably, the WebLogic Server Monitor was locking the weblogic.jar, so you couldn't upgrade the server.
可能是 WebLogic Server Monitor 锁定了 weblogic.jar,因此您无法升级服务器。
I had the same issue and solved it by switching to a new workspace. There, I could add the server again and upgrade it, without being disturbed by the WebLogic Server Monitor.
我遇到了同样的问题,并通过切换到新工作区来解决它。在那里,我可以再次添加服务器并升级它,而不会受到 WebLogic Server Monitor 的干扰。