-
1. JBoss 4.2.2 / Hibernate 3.3.2 compatibility
jaikiran Feb 21, 2011 1:18 AM (in response to jbossbeginner)1 of 1 people found this helpfulA better option is to package the hibernate jars (of the version of your choice) within your application and not touch the ones shipped in JBoss AS. See if this helps http://jaitechwriteups.blogspot.com/2008/08/how-to-upgrade-hibernate-in-jboss.html
-
2. JBoss 4.2.2 / Hibernate 3.3.2 compatibility
jbossbeginner Feb 22, 2011 9:24 AM (in response to jaikiran)Thanks for your advice Jaikiran.
I've folowed your tuto and adapted it to my needs for Hibernate 3.3.2.
I got the following jar in the application package (based on official compatibility matrix mention before):
MyApp.ear
|
|--- META-INF
| |
| |
| |--- application.xml
| |
| |--- jboss-app.xml
|
|
| --- [some jar files required by my app]
|
| --- ejb3-persistence-1.0.2.GA.jar
|
| --- hibernate-annotations-3.4.0.GA.jar
|
| --- hibernate-commons-annotations-3.1.0.GA.jar
|
| --- hibernate-core-3.3.2.GA.jar
|
| --- hibernate-entitymanager-3.4.0.GA.jar
|
| --- hibernate-validator-3.1.0.GA.jar
|
The jboss-app.xml is generated using Maven ear plugin.
It generate this:
<jboss-app>
<unauthenticated-principal>guest</unauthenticated-principal>
<loader-repository>com.company:loader=MyApp.ear</loader-repository>
</jboss-app>
But I still got an exception:
Problem starting service persistence.units:ear=...
...
java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persistence.spi.PersistenceProvider
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
Do you know this exception?
-
3. JBoss 4.2.2 / Hibernate 3.3.2 compatibility
jaikiran Feb 22, 2011 9:30 AM (in response to jbossbeginner)What are the "other" jar files that you are packaging? Do you have jar file(s) in your application with contain javax.persistence.* classes? If yes, remove those jar files from your application packaging.