6 Replies Latest reply on Jan 21, 2011 9:00 PM by Lawrence Li

    Seam + Liferay + Icefaces

    mladen babic Newbie
      We are currently developing some portlets under Seam 2.0.2.GA, Icefaces 1.7.2 and Liferay Portal 5.1.1 (Jboss bundle) !
      Unfortunately the newer 5.1.2 and Seam 2.1.0.GA are not as compatible as 2.0.2.GA and 5.1.1

      We do however encounter one BIG problem in all possible combinations of Seam, icefaces and liferay portal, which is the incompatibility between seam's transaction management and liferay's spring based transaction management.

      We cannot use any of the liferay Services and/or LocalServices because of the seam managed transactions, which do not allow for commits to be placed during a seam managed transaction.

      Does anyone know, how to make the two work together?
      Any help would be appreciated.
      Below is a Stacktrace we receive when we try to save e.g. portlet preferences using liferay's service (wrapped inside an Icefaces' managed bean)

      08:43:23,171 ERROR [JDBCTransaction] Could not toggle autocommit
      java.sql.SQLException: You cannot set autocommit during a managed transaction!
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.setJdbcAutoCommit(BaseWrapperManagedConnection.j
      ava:482)
      at org.jboss.resource.adapter.jdbc.WrappedConnection.setAutoCommit(WrappedConnection.java:322)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(Lazy
      ConnectionDataSourceProxy.java:364)
      at $Proxy56.setAutoCommit(Unknown Source)
      at org.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTransaction.java:194)
      at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:142)
      at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
      at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:606)

      at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTran
      sactionManager.java:709)
      at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransaction
      Manager.java:678)
      at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(Transact
      ionAspectSupport.java:321)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy166.updatePreferences(Unknown Source)
      at com.liferay.portal.service.PortletPreferencesLocalServiceUtil.updatePreferences(PortletPreferencesLocalServic
      eUtil.java:179)
      at com.liferay.portlet.PortletPreferencesImpl.store(PortletPreferencesImpl.java:256)
      at com.liferay.portlet.PortletPreferencesWrapper.store(PortletPreferencesWrapper.java:105)
      at com.liferay.util.bridges.jsf.common.PortletPreferencesManagedBean.submit(PortletPreferencesManagedBean.java:1
      29)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
      at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
      at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
      at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:7
      7)
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
      at javax.faces.component.UICommand.broadcast(UICommand.java:383)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
      at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:94)
      at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:54)
      at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:26)
      at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
      at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
      at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$1.service(SessionDispatcher.java:38)
      at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.jav
      a:19)
      at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
      at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:55)
      at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:19)
      at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
      at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:91)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Thread.java:595)
      08:43:23,171 ERROR [JDBCTransaction] JDBC commit failed
      java.sql.SQLException: You cannot commit during a managed transaction!
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:543
      )
      at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:334)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(Lazy
      ConnectionDataSourceProxy.java:364)
      at $Proxy56.commit(Unknown Source)
      at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
      at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
      at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:606)

      at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTran
      sactionManager.java:709)
      at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransaction
      Manager.java:678)
      at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(Transact
      ionAspectSupport.java:321)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy166.updatePreferences(Unknown Source)
      at com.liferay.portal.service.PortletPreferencesLocalServiceUtil.updatePreferences(PortletPreferencesLocalServic
      eUtil.java:179)
      at com.liferay.portlet.PortletPreferencesImpl.store(PortletPreferencesImpl.java:256)
      at com.liferay.portlet.PortletPreferencesWrapper.store(PortletPreferencesWrapper.java:105)
      at com.liferay.util.bridges.jsf.common.PortletPreferencesManagedBean.submit(PortletPreferencesManagedBean.java:1
      29)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
      at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
      at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
      at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:7
      7)
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
      at javax.faces.component.UICommand.broadcast(UICommand.java:383)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
      at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:94)
      at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:54)
      at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:26)
      at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
      at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
      at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$1.service(SessionDispatcher.java:38)
      at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.jav
      a:19)
      at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
      at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:55)
      at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:19)
      at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
      at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:91)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Thread.java:595)
      08:43:23,171 ERROR [PortletPreferencesManagedBean] org.springframework.transaction.TransactionSystemException: Could not
      commit Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC commit failed
      org.springframework.transaction.TransactionSystemException: Could not commit Hibernate transaction; nested exception is
      org.hibernate.TransactionException: JDBC commit failed
      at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:610)

      at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTran
      sactionManager.java:709)
      at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransaction
      Manager.java:678)
      at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(Transact
      ionAspectSupport.java:321)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy166.updatePreferences(Unknown Source)
      at com.liferay.portal.service.PortletPreferencesLocalServiceUtil.updatePreferences(PortletPreferencesLocalServic
      eUtil.java:179)
      at com.liferay.portlet.PortletPreferencesImpl.store(PortletPreferencesImpl.java:256)
      at com.liferay.portlet.PortletPreferencesWrapper.store(PortletPreferencesWrapper.java:105)
      at com.liferay.util.bridges.jsf.common.PortletPreferencesManagedBean.submit(PortletPreferencesManagedBean.java:1
      29)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
      at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
      at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
      at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:7
      7)
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
      at javax.faces.component.UICommand.broadcast(UICommand.java:383)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
      at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:94)
      at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:54)
      at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:26)
      at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
      at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
      at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$1.service(SessionDispatcher.java:38)
      at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.jav
      a:19)
      at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
      at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:55)
      at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:19)
      at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
      at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:91)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: org.hibernate.TransactionException: JDBC commit failed
      at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:130)
      at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:606)

      ... 63 more
      Caused by: java.sql.SQLException: You cannot commit during a managed transaction!
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:543
      )
      at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:334)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(Lazy
      ConnectionDataSourceProxy.java:364)
      at $Proxy56.commit(Unknown Source)
      at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
      at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
      ... 64 more
      08:43:23,250 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
      sourceId=null[severity=(ERROR 2), summary=(An error occurred while updating your preferences.), detail=(An error occurre
      d while updating your preferences.)]
        • 1. Re: Seam + Liferay + Icefaces
          Guillaume Jeudy Master

          Check out this article on how to use Seam managed persistence context with spring managed transactions.


          I hope it helps.

          • 2. Re: Seam + Liferay + Icefaces
            mladen babic Newbie

            As far as I know, this is a solution only if seam and spring are in the same web app.
            Liferay Portal is a seperate Web app. Our portlets are also seperate web apps.
            Your suggestion does not apply here.
            Correct me if I'm wrong!

            • 3. Re: Seam + Liferay + Icefaces
              Lawrence Li Newbie

              Hi Mladen,


              Did you ever solve this issue?  I'm running into the same issue right now and cannot find a solution for this issue.

              • 4. Re: Seam + Liferay + Icefaces
                mladen babic Newbie
                Hi,Lawrence.
                Yes, I solved this issue. If I remember well, main problem was with seam transaction and liferay transaction, so there are two solutions:

                1. Change transaction type from JTA to RESOURCE_LOCAL in |persistance.xml| or
                2. Create web service functionality and call liferay methods as web service.

                We use first option. Hope that helps.

                Best regards,
                MB
                • 5. Re: Seam + Liferay + Icefaces
                  Lawrence Li Newbie

                  Thanks for the suggestions, Mladen.


                  I tried suggestion 1 and it worked!  Hopefully, I'm not going to lose too much by abandoning JTA - I may need JTA in the future, so I may have to revert to use JTA.


                  Suggestion 2 is very interesting.  I never thought about using Web services to access Liferay...


                  BTW, I seem to experience issues with the Liferay/Seam/ICEfaces from time to time where the JDBC connection gets disconnected for no apparent reason...  Working with Liferay/Seam/ICEfaces is a bit challenging at times and I'm sure I'll run across additional undocumented issues as I progress.  :)

                  • 6. Re: Seam + Liferay + Icefaces
                    Lawrence Li Newbie

                    Hi Mladen (and anyone else who may be able to answer this issue),


                    I've come to the point where I need to use JTA instead of RESOURCE_LOCAL for a few reasons:


                    - Clustering
                    - Multiple entity managers for the same persistence unit


                    etc.


                    I was going to start using Liferay Web services instead of the Liferay API to allow me to do this.  Unfortunately, when I examined the WSDL file, I noticed there was not a one to one relationship between Web service operations and the Liferay API.  For example, I could not find a Liferay Web service operation in the WSDL for the Liferay IGImageLocalServiceUtil.addImage method call.  Thus, there are numerous Web service operations missing.  See the Liferay forum message for more details.


                    Thus, I'm wondering if you (or anyone else) knows how to get around this limitation.  How should I configure my Seam/Liferay/ICEfaces app to use JTA?  Please help - as this is a showstopper for me right now.