JBoss 5.1.0.GA中的Hibernate 3.5-Final [英] Hibernate 3.5-Final in JBoss 5.1.0.GA

查看:146
本文介绍了JBoss 5.1.0.GA中的Hibernate 3.5-Final的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hibernate 3.5-Final 终于来了,它提供了备受期待的JPA2支持以及其他功能。我正在使用JBoss 5.1.0.GA和Hibernate 3.3开发一个项目(基于EJB3),但我想利用JPA2并尝试升级到Hibernate 3.5。



我所做的只是相当简单和标准的 - 我只是将所有的hibernate 3.5 jar放入服务器/配置文件(默认,所有等)/ lib文件夹 - 这样它们优先于JBoss附带的hibernate工件。看起来,虽然JBoss提供了依赖于hibernate 3.3的JPA1实现部分的库,因为我开始收集有关未实现的抽象方法和类似部署的错误:

  23:21:26,792 WARN [Ejb3Configuration]持久性提供者调用者没有正确实现EJB3规范。 PersistenceUnitInfo.getNewTempClassLoader()为null。 
23:21:26,792错误[AbstractKernelController]错误安装到开始: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;
在org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:613)
在org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
在org.jboss .jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)
at sun.reflect.GeneratedMethodAccessor308.invoke(Unknown Source)

也许我应该使用提供的不同持久性?目前它是:
$ b


org.hibernate.ejb.HibernatePersistence


我环顾网络,没有找到任何文件化的升级路径。在这个话题的堆栈溢出中,甚至还有一个没有答案的问题。

任何想法,建议?在此先感谢您的帮助。

解决方案


似乎JBoss提供了依赖于JPA1实现部分的库hibernate 3.3


是的,它的确如此(参见这个旧邮件以获得一个想法),我不认为你目前的做法是可能的。我的理解是,JPA 2集成计划用于 JBoss 5.2 但似乎他们决定跳过这个分支直接转到JBoss 6.x.

Hibernate 3.5-Final is 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.

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:

    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

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.

解决方案

It seems though that JBoss ships with libraries that are dependent on the JPA1 implementation part of the hibernate 3.3

Yes, it does (see this old mail to 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.2 but it seems that they decided to skip this branch to go directly to JBoss 6.x.

这篇关于JBoss 5.1.0.GA中的Hibernate 3.5-Final的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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