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:
6. Add Hibernate implementation jars of your preferred version to server/common/lib, instead. I used: