English 中文(简体)
Hibernate 3.5-Final in JBoss 5.1.0.GA
原标题:

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.

问题回答

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?)

I also added some instructions to the above link that worked for me.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签