java JBoss 5.1.0.GA 中的 Hibernate 3.5-Final
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2588108/
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
Hibernate 3.5-Final in JBoss 5.1.0.GA
提问by Bozhidar Batsov
Hibernate 3.5-Finalis finally here and it offers the much anticipated JPA2 support, amongst other features. I am working on a project(EJB3 based) using JBoss 5.1.0.GA and Hibernate 3.3, but I wanted to take advantage of the JPA2 and tried to upgrade to Hibernate 3.5.
Hibernate 3.5-Final终于来了,它提供了备受期待的 JPA2 支持以及其他功能。我正在使用 JBoss 5.1.0.GA 和 Hibernate 3.3 开发一个项目(基于 EJB3),但我想利用 JPA2 并尝试升级到 Hibernate 3.5。
What I did was fairly simple and standard - I just put all the hibernate 3.5 jars in the server/configuration(default,all,etc)/lib folder - that way they take precedence over the hibernate artifacts shipped with JBoss. It seems though that JBoss ships with libraries that are dependent on the JPA1 implementation part of the hibernate 3.3, because I started getting some errors about unimplemented abstract methods and stuff like that on deploy:
我所做的相当简单和标准——我只是将所有的 hibernate 3.5 jars 放在 server/configuration(default,all,etc)/lib 文件夹中——这样它们优先于 JBoss 附带的 hibernate artifacts。似乎 JBoss 附带的库依赖于 hibernate 3.3 的 JPA1 实现部分,因为我开始收到一些关于未实现的抽象方法和类似内容的错误部署:
23:21:26,792 WARN [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
23:21:26,792 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=kernel-ear-3.3.0-SNAPSHOT.ear/config-persistence.jar#ConfigurationPersistenceUnit state=Create
java.lang.AbstractMethodError: org.jboss.jpa.deployment.PersistenceUnitInfoImpl.getValidationMode()Ljavax/persistence/ValidationMode;
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:613)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)
at sun.reflect.GeneratedMethodAccessor308.invoke(Unknown Source)
Maybe I should use a different persistence provided? Currently it's:
也许我应该使用提供的不同持久性?目前是:
org.hibernate.ejb.HibernatePersistence
org.hibernate.ejb.HibernatePersistence
I looked around the net and didn't find any documented upgrade paths. There was even an unanswered question here in stack overflow on the topic.
我环顾网络,没有找到任何记录在案的升级路径。在这个话题的堆栈溢出中,甚至还有一个悬而未决的问题。
Any ideas, suggestions? Thanks in advance for your help.
任何想法,建议?在此先感谢您的帮助。
采纳答案by Pascal Thivent
It seems though that JBoss ships with libraries that are dependent on the JPA1 implementation part of the hibernate 3.3
虽然 JBoss 附带的库依赖于 hibernate 3.3 的 JPA1 实现部分
Yes, it does (see this old mailto get an idea) and I don't think that your current approach is possible. My understanding is that JPA 2 integration was planned for JBoss 5.2but it seems that they decided to skip this branch to go directly to JBoss 6.x.
是的,确实如此(请参阅此旧邮件以获取想法)并且我认为您当前的方法是不可能的。我的理解是JBoss 5.2计划集成 JPA 2,但似乎他们决定跳过这个分支直接进入 JBoss 6.x。
回答by Stephan
I have build a workaround for this specific issue. Instead of re-explaining it here, I prefer send you directly the link to the post with all details.
我已经为这个特定问题建立了一个解决方法。与其在此重新解释,我更愿意直接向您发送包含所有详细信息的帖子链接。
You can find here : How to use JPA2 on JBoss 5.x ? (or How to eliminate class loading isolation issue?)
回答by Hank Ratzesberger
I also added some instructions to the above link that worked for me.
我还在上面的链接中添加了一些对我有用的说明。

