Bug 724746 (JBWFK-108)

Summary: CLONE - Spring integration with Seam does not work on EWS with EAP based Seam
Product: [JBoss] JBoss Enterprise WFK Platform 1 Reporter: Karel Piwko <kpiwko>
Component: SpringAssignee: Rebecca Newton <rebecca.jboss>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: medium    
Version: unspecifiedCC: kpiwko, mnovotny, rebecca.jboss
Target Milestone: ---   
Target Release: 1.2.0.GA   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBWFK-108
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
EWS-1.0.2 Tomcat 5, Tomcat6, Spring 2.5.6.SEC02, Seam 2.2.2.EAP5 Seam 2.2.3.EAP5 (EAP-5.1.1-ER2) RHEL5
Last Closed: 2011-06-06 15:36:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
EAP+Seam_2+Spring_2.5.txt
none
EWS_Tomcat5+Seam_2+Spring_2.5.txt
none
EWS_Tomcat6+Seam_2+Spring_2.5.txt none

Description Karel Piwko 2011-05-25 08:31:50 UTC
Affects: Release Notes
securitylevel_name: Public

There is an example of Seam-Spring integration at
https://svn.devel.redhat.com/repos/jboss-qa/wfk/trunk/spring/seamspring.

This example uses a distribution of Seam to get dependencies. The build is working on EAP 5 and EWS 5, which both contain Seam distribution includes. On EWS, we used Seam packaged with EAP, however it failed to run after an successful deployment. Community version of Seam 2.2.x is working though.

Seam in the EAP is missing some libraries compared to the community version (slf4j-impl, different cglib), if they are replaced, it seams that Tomcat class loader is not able to load class definitions even if we used unsigned jars.

[java] 13:37:11,078 WARN  [Contexts] Exception destroying context
     [java] org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.ejb.Ejb3Configuration
     [java]     at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:375)
     [java]     at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:374)
     [java]     at org.jboss.seam.ioc.spring.SpringTransaction.begin(SpringTransaction.java:67)
     [java]     at org.jboss.seam.util.Work.workInTransaction(Work.java:58)
     [java]     at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:350)
     [java]     at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
     [java]     at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:514)
     [java]     at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:249)
     [java]     at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
     [java]     at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
     [java]     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
     [java]     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
     [java]     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
     [java]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     [java]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     [java]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
     [java]     at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
     [java]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
     [java]     at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
     [java]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
     [java]     at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
     [java]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
     [java]     at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
     [java]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
     [java]     at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
     [java]     at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
     [java]     at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
     [java]     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
     [java]     at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
     [java]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
     [java]     at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
     [java]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
     [java]     at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
     [java]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
     [java]     at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
     [java]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     [java]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     [java]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     [java]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     [java]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
     [java]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     [java]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     [java]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
     [java]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
     [java]     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
     [java]     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
     [java]     at java.lang.Thread.run(Thread.java:619)
     [java] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.ejb.Ejb3Configuration
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
     [java]     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
     [java]     at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
     [java]     at org.springframework.web.jsf.DelegatingVariableResolver.resolveSpringBean(DelegatingVariableResolver.java:138)
     [java]     at org.springframework.web.jsf.DelegatingVariableResolver.resolveVariable(DelegatingVariableResolver.java:111)
     [java]     at com.sun.faces.el.VariableResolverChainWrapper.getValue(VariableResolverChainWrapper.java:107)
     [java]     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
     [java]     at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
     [java]     at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
     [java]     at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
     [java]     at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
     [java]     at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:234)
     [java]     at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:78)
     [java]     at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:107)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
     [java]     at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
     [java]     at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
     [java]     at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
     [java]     at org.jboss.seam.Component.unwrap(Component.java:2275)
     [java]     at org.jboss.seam.Component.getInstance(Component.java:2041)
     [java]     at org.jboss.seam.Component.getInstance(Component.java:1983)
     [java]     at org.jboss.seam.Component.getInstance(Component.java:1977)
     [java]     at org.jboss.seam.Component.getInstance(Component.java:1972)
     [java]     at org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactory.createEntityManager(SeamManagedEntityManagerFactory.java:59)
     [java]     at org.springframework.orm.jpa.JpaTransactionManager.createEntityManagerForTransaction(JpaTransactionManager.java:392)
     [java]     at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:320)
     [java]     ... 46 more
     [java] Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.ejb.Ejb3Configuration
     [java]     at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:130)
     [java]     at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:224)
     [java]     at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:291)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
     [java]     ... 82 more

Comment 1 Karel Piwko 2011-05-25 08:31:50 UTC
Link: Added: This issue Cloned from JBPAPP-4405


Comment 3 Karel Piwko 2011-05-26 12:59:09 UTC
Workaround Description: Removed: Use Seam 2.2.0.GA when integrating Seam with Spring on EWS. 
Workaround: Removed: [Workaround Exists] 


Comment 4 Marek Novotny 2011-05-27 13:08:08 UTC
if it now works, resolve it and include it in Fixed issues in Release Notes

Comment 5 Karel Piwko 2011-05-30 10:46:30 UTC
Attaching EWS Tomcat 5 and EWS Tomcat 6 dependencies, EAP dependencies for comparing.

Comment 6 Karel Piwko 2011-05-30 10:46:30 UTC
Attachment: Added: EAP+Seam_2+Spring_2.5.txt
Attachment: Added: EWS_Tomcat5+Seam_2+Spring_2.5.txt
Attachment: Added: EWS_Tomcat6+Seam_2+Spring_2.5.txt


Comment 7 Karel Piwko 2011-05-30 10:55:06 UTC
See attached files for detailed library versions. To make EWS working with Seam distributed with EWS combine versions as following:

Tomcat 5:
dom4j, antlr, hibernate-entitymanager,hibernate-core, hibernate-annotations, hibernate-commons-annotations, javassist, slf4j-api from EWS Hibernate
jsf-api, jsf-impl, richfaces-api, richfaces-impl, richfaces-ui from WFK
hibernate-search, jboss-seam-ui, jboss-seam-ioc, jboss-seam-debug, jboss-seam, jboss-el from EAP Seam

Other libraries (persistence-api, transaction-api, hibernate-validator, jsf-facelets, commons-collections, commons-beanutils, commons-digester, lucene-core, hsqldb, slf4j-log4j12, jcl-over-slf4j, log4j, testng, junit, spring, cglib, asm, el-api, el-ri should be in their community versions. 

Tomcat 6:

el-ri should not be included, the rest is the same as for Tomcat5

Comment 8 Karel Piwko 2011-05-30 10:55:59 UTC
Release Notes Docs Status: Removed: Documented as Known Issue Added: Not Yet Documented
Release Notes Text: Removed: Seam-Spring integration does not work on JBoss Enterprise Web Server with the included version of Seam because of a number of library changes which prevent the Tomcat classloader from loading class definitions. To work around this issue, use Seam 2.2.0.GA for Seam-Spring integration on JBoss Enterprise Web Server. 


Comment 10 Rebecca Newton 2011-05-31 06:41:59 UTC
Hi Karel, changes available here on stage: http://documentation-stage.bne.redhat.com/docs/en-US/JBoss_Web_Framework_Kit/1.2/html/Release_Notes_1.2.0/Issues-fixed-in-this-release.html Let me know how they look.

Comment 12 Rebecca Newton 2011-06-01 04:46:48 UTC
Hi Karel, have made these changes, available here: http://documentation-stage.bne.redhat.com/docs/en-US/JBoss_Web_Framework_Kit/1.2/html/Release_Notes_1.2.0/index.html