Deploying self-contained Spring apps on JBoss 5.1.GA

Recently, I was in need to deploy Spring's sample Travel web application on JBoss 5.1. The process of making the deployment pass mainly consisted of solving mismatches between JBoss JPA and the web-application-contained Hibernate. I hope the following description of the steps will help others (diminishing bunch?)  deploy Spring apps on JBoss 5.1.


1. Remove logj jar from your WEB-INF/lib


2. Remove xml-apis jar from your WEB-INF/lib


3. Rename your persistence.xml (mine was under WEB-INF/classes/META-INF/), for example, to jpa-persistence.xml


4. Modify hibernate configuration (mine was under WEB-INF/classes/META-INF/spring/data.xml), adding the following to your entityManagerFactory bean definition: <property name="persistenceXmlLocation" value="classpath:META-INF/jpa-persistence.xml" />


5. Remove the following Hibernate implementation jars in server/common/lib:

hibernate-annotations.jar

hibernate-commons-annotations.jar

hibernate-core.jar

hibernate-entitymanager.jar

hibernate-validator.jar


6. Add Hibernate implementation jars of your preferred version to server/common/lib, instead. I used:

hibernate-annotations-3.5.0-Final.jar

hibernate-commons-annotations-3.2.0.Final.jar

hibernate-core-3.5.0-Final.jar

hibernate-entitymanager-3.5.0-Final.jar

hibernate-jpa-2.0-api-1.0.0.Final.jar

hibernate-validator-4.0.2.GA.jar

 


Thank you for your interest!

We will contact you as soon as possible.

Send us a message

Oops, something went wrong
Please try again or contact us by email at info@tikalk.com