aspose file tools*
The moose likes JBoss/WildFly and the fly likes JBoss 7.1.1.Final: how to exclude Hibernate 4 and use the version packaged in the application ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss 7.1.1.Final: how to exclude Hibernate 4 and use the version packaged in the application ?" Watch "JBoss 7.1.1.Final: how to exclude Hibernate 4 and use the version packaged in the application ?" New topic
Author

JBoss 7.1.1.Final: how to exclude Hibernate 4 and use the version packaged in the application ?

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Hi,





My web application (WAR file) already contains Hibernate :



WEB-INF\lib\hibernate-jpa-2.0-api-1.0.1.Final.jar

WEB-INF\lib\hibernate-entitymanager-3.6.5.Final.jar

WEB-INF\lib\hibernate-core-3.3.0.SP1.jar

WEB-INF\lib\hibernate-commons-annotations-3.1.0.GA.jar

WEB-INF\lib\hibernate-annotations-3.4.0.GA.jar



I do not want JBoss 7.1.1.Final to load its version which is located in the folder jboss-as-7.1.1.Final\modules\org\hibernate\main



I already know that i need to add the following line to the persistence.xml file :


(as mentioned in https://docs.jboss.org/author/display/AS7/JPA+Reference+Guide).



I get the following error when i try to deploy the WAR file :


Any idea ? something to do with Infinispan apparently. Can i turn it off ? If yes, where ?

Thanks in advance for helping.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

You will need to create a jboss-deployment-structure.xml file in the root META-INF of your webapp.

Then tell it to exclude loading the hibernate module.



WP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss 7.1.1.Final: how to exclude Hibernate 4 and use the version packaged in the application ?