Hibernate 3.5-Final in JBoss 5.1.0.GA
Asked Answered
E

3

8

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.

Erogenous answered 6/4, 2010 at 20:36 Comment(4)
Upgrading Hibernate within JBossAS is rarely easy, as you've discovered. The inter-dependencies are just too tight for all but the most trivial JBoss configurations.Leasia
Try using a diferent name for your persistence.xml file, like foo-persistence.xmlCraner
hi, were you able to resolve this? I am after doing something same and facing lot of difficulties.Chino
See this thread: #10140670Wystand
G
7

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.

Gasket answered 7/4, 2010 at 23:31 Comment(2)
Yes, I'm aware of the plan to include JPA2 in JBoss 5.2 and then the decision to go straight for JBoss 6. I hoped, however, they would at least provide an upgrade path for JBoss 5.1 users since it's unlikely that many of them will adopt 6.x very early. Thanks for the answer.Erogenous
I was actually going through the same exercise and was able to pack all 3.5.x dependent jars to my ear, but there was an error parsing the persistence.xml file. It's unable to override dependencies from the jboss.home/commons/lib folderStereopticon
D
0

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

Dhumma answered 5/1, 2012 at 11:51 Comment(0)
A
0

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

Aristippus answered 2/10, 2014 at 18:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.