1 of 1 people found this helpful
A 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
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):
| |--- 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:
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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Do you know this exception?
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.