4.3.2. Migrate the Seam 2.2 JPA Example to JBoss Enterprise Application Platform 6
Summary
The following task list summarizes the changes needed to successfully migrate the Seam 2.2 JPA example application to JBoss Enterprise Application Platform 6. This example application can be found in the JBoss Enterprise Application Platform 5.1 distribution under EAP5.1_HOME/jboss-eap-5.1/seam/examples/jpa/
Important
Applications that use Hibernate directly with Seam 2.2 may use a version of Hibernate 3 packaged inside the application. Hibernate 4, which is provided through the org.hibernate module of JBoss Enterprise Application Platform 6, is not supported by Seam 2.2. This example is intended to help you get your application running on JBoss Enterprise Application Platform 6 as a first step. Please be aware that packaging Hibernate 3 with a Seam 2.2 application is not a supported configuration.
Procedure 4.12. Task
Remove the jboss-web.xml file
Remove thejboss-web.xml
file from thejboss-seam-jpa.war/WEB-INF/
directory. The class loading defined in thejboss-web.xml
is now the default behavior.Remove obsolete property from the persistence.xml file
Remove or comment out thehibernate.cache.provider_class
property in thejboss-seam-jpa.war/WEB-INF/classes/META-INF/persistence.xml
file:<!-- <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/> -->
Add Seam 2.2 dependencies
Copy the following JARs from the Seam 2.2 distribution library,SEAM_HOME/lib/
, into thejboss-seam-jpa.war/WEB-INF/lib/
directory:- slf4j-api.jar
- slf4j-log4j12.jar
- hibernate-entitymanager.jar
- hibernate-core.jar
- hibernate-annotations.jar
- hibernate-commons-annotations.jar
- hibernate-validator.jar
Create a jboss-deployment-structure file to add remaining dependencies
Create ajboss-deployment-structure.xml
file in thejboss-seam-jpa.war/WEB-INF/
folder containing the following data:<jboss-deployment-structure> <deployment> <exclusions> <module name="javax.faces.api" slot="main"/> <module name="com.sun.jsf-impl" slot="main"/> </exclusions> <dependencies> <module name="org.apache.log4j" /> <module name="org.dom4j" /> <module name="org.apache.commons.logging" /> <module name="org.apache.commons.collections" /> <module name="javax.faces.api" slot="1.2"/> <module name="com.sun.jsf-impl" slot="1.2"/> </dependencies> </deployment> </jboss-deployment-structure>
Result:
The Seam 2.2 JPA example application deploys and runs successfully on JBoss Enterprise Application Platform 6.