aspose file tools*
The moose likes JBoss/WildFly and the fly likes Having trouble using my version of Hibernate instead of JBoss' in a JAR application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Having trouble using my version of Hibernate instead of JBoss Watch "Having trouble using my version of Hibernate instead of JBoss New topic
Author

Having trouble using my version of Hibernate instead of JBoss' in a JAR application

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

I'm trying to deploy a JAR file to JBoss 4.2.2.GA (don't have control over the server version). Our application uses Hibernate 4.0.1.Final, which we include through Maven like so ...



I also have a jboss-app.xml file to tell JBoss to use our files instead of its own ...



However, when I deploy our JAR file to JBoss, we get errors indicating that JBoss is using its own Hibernate 3 classes (e.g. "org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="com.mainco.fdr.lycea.model.UserRole"/>"). The structure of the JAR is like so

META-INF/jboss-app.xml
...
org/hibernate/cfg/Configuration.class
...

Any ideas how we can tell JBoss to use our Hibernate over its Hibernate?

Thanks, - Dave
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Having trouble using my version of Hibernate instead of JBoss' in a JAR application