Hide Forgot
Title: Migrate the Seam 2.2 JPA Example to JBoss EAP 6 Describe the issue: The steps described in Migrate the Seam 2.2 JPA Example to JBoss EAP 6 are incomplete and the result will not be a fully functional JPA example application. Suggestions for improvement: Missing steps are * adding hibernate exclusions to jboss-dependency-structure.xml: <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0"> <deployment> <exclusions> <module name="javax.faces.api" slot="main"/> <module name="com.sun.jsf-impl" slot="main"/> <module name="org.hibernate" 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> * adding <property name="jboss.as.jpa.providerModule" value="hibernate3-bundled" /> to the persistence.xml * changing the default datasource JNDI to java:jboss/datasources/ExampleDS Additional information: (see also http://documentation-devel.engineering.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/6.2/html/Migration_Guide/sect-Migrate_Seam_2.2_Applications.html )
(the application deploys, but attempting to book a hotel will fail, with the following error in the server log: 10:40:56,558 ERROR [org.hibernate.engine.transaction.internal.SynchronizationRegistryImpl] (http-/127.0.0.1:8080-3) HHH000260: Exception calling user Synchronization [TransactionSuccessEvent(bookingConfirmed)] : javax.persistence.PersistenceException: org.hibernate.TransactionException: reuse of Transaction instances not supported
Hi Marek, The jboss-deployment structure is documented in step 4, however, it was missing the "org.hibernate" exclusion. Modifed topic 4952: Migrate the Seam 2.2 JPA Example to JBoss EAP 6
Fix is staged here: http://documentation-devel.engineering.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/6.2/html-single/Migration_Guide/index.html#Migrate_the_Seam_22_JPA_Example_to_JBoss_Enterprise_Application_Platform_6
The changes are fine, however I have missed one detail: The list of jars in "3. Add Seam 2.2 dependencies" is incomplete, "antlr.jar" needs to be added to the list, so the full list of jars to copy should be: antlr.jar slf4j-api.jar slf4j-log4j12.jar hibernate-entitymanager.jar hibernate-core.jar hibernate-annotations.jar hibernate-commons-annotations.jar hibernate-validator.jar (otherwise you get java.lang.ClassNotFoundException: antlr.RecognitionException after trying to login)
Thanks Marek Fixed topic 4952.
Migration Guide has not been staged.
Migration Guide has still not been staged.
The fix is staged here: http://documentation-devel.engineering.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/6.2/html-single/Migration_Guide/index.html#Migrate_the_Seam_22_JPA_Example_to_JBoss_Enterprise_Application_Platform_6
Verified on EAP 6.2.0.CR2 preview