12 Replies Latest reply on Jun 1, 2011 9:50 AM by andre.pankraz

    ejb-transaction in seam

    andre.pankraz

      Seam 2.2 + Portlet Container 2 SNAPSHOT + JBoss Portal 2.7.2

      If i activate
      <transaction:ejb-transaction />
      than i get this error in the portlet environment:

      17:31:17,854 ERROR [Exceptions] handled and logged exception
      java.lang.IllegalStateException: Could not commit transaction
       at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:625)
       at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:604)
       at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:345)
       at org.jboss.seam.jsf.SeamPhaseListenerWrapper.afterPortletPhase(SeamPhaseListenerWrapper.java:123)
       at org.jboss.seam.jsf.SeamPhaseListenerWrapper.afterPhase(SeamPhaseListenerWrapper.java:84)
       at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:87)
       at org.jboss.portletbridge.lifecycle.PortletLifecycle.render(PortletLifecycle.java:155)
       at org.jboss.portletbridge.AjaxPortletBridge.render(AjaxPortletBridge.java:1072)
       at org.jboss.portletbridge.AjaxPortletBridge.renderResponse(AjaxPortletBridge.java:886)
       at org.jboss.portletbridge.AjaxPortletBridge.doFacesRequest(AjaxPortletBridge.java:625)
       at javax.portlet.faces.GenericFacesPortlet.doFacesDispatch(GenericFacesPortlet.java:598)
       at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:486)
       at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
       at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:457)
       at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
       at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl$Invoker.doFilter(PortletContainerImpl.java:568)
       at org.jboss.portal.portlet.impl.jsr168.api.FilterChainImpl.doFilter(FilterChainImpl.java:159)
       at org.jboss.portal.portlet.impl.jsr168.api.FilterChainImpl.doFilter(FilterChainImpl.java:80)
       at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.dispatch(PortletContainerImpl.java:505)
       at org.jboss.portal.portlet.container.ContainerPortletDispatcher.invoke(ContainerPortletDispatcher.java:42)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.org$jboss$portal$core$aspects$portlet$TransactionInterceptor$invokeNotSupported$aop(TransactionInterceptor.java:97)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N6922078035659651697.invokeNext(TransactionInterceptor$invokeNotSupported_N6922078035659651697.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
       at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:112)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N6922078035659651697.invokeNext(TransactionInterceptor$invokeNotSupported_N6922078035659651697.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
       at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:102)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N6922078035659651697.invokeNext(TransactionInterceptor$invokeNotSupported_N6922078035659651697.java)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invokeNotSupported(TransactionInterceptor.java)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.core.aspects.portlet.HeaderInterceptor.invoke(HeaderInterceptor.java:49)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.aspects.portlet.EventPayloadInterceptor.invoke(EventPayloadInterceptor.java:196)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.aspects.portlet.RequestAttributeConversationInterceptor.invoke(RequestAttributeConversationInterceptor.java:119)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.core.aspects.portlet.SignOutInterceptor.invoke(SignOutInterceptor.java:43)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.core.aspects.portlet.AjaxInterceptor.invoke(AjaxInterceptor.java:49)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.core.aspects.portlet.BackwardCompatibilityInterceptor.invoke(BackwardCompatibilityInterceptor.java:46)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.bridge.BridgeInterceptor.invoke(BridgeInterceptor.java:49)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.aspects.portlet.PortletSessionSynchronizationInterceptor.invoke(PortletSessionSynchronizationInterceptor.java:82)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.aspects.portlet.ContextTrackerInterceptor.invoke(ContextTrackerInterceptor.java:48)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor.access$001(ContextDispatcherInterceptor.java:49)
       at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor$1.doCallback(ContextDispatcherInterceptor.java:123)
       at org.jboss.portal.web.command.CommandDispatcher$CallbackCommand.execute(CommandDispatcher.java:74)
       at sun.reflect.GeneratedMethodAccessor461.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.portal.web.command.CommandServlet.doGet(CommandServlet.java:130)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
       at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
       at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
       at org.jboss.portal.web.command.CommandServlet.include(CommandServlet.java:79)
       at org.jboss.portal.web.command.CommandDispatcher.include(CommandDispatcher.java:50)
       at org.jboss.portal.web.jboss.JBossWebContext.include(JBossWebContext.java:66)
       at org.jboss.portal.web.impl.DefaultServletContainer.include(DefaultServletContainer.java:190)
       at org.jboss.portal.portlet.impl.spi.AbstractServerContext.dispatch(AbstractServerContext.java:69)
       at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:77)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:69)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.aspects.portlet.ValveInterceptor.invoke(ValveInterceptor.java:75)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.container.ContainerPortletInvoker.invoke(ContainerPortletInvoker.java:116)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.state.producer.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java:221)
       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker.org$jboss$portal$core$impl$portlet$state$ProducerPortletInvoker$invoke$aop(ProducerPortletInvoker.java:53)
       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java)
       at org.jboss.portal.portlet.federation.impl.FederatedPortletInvokerService.invoke(FederatedPortletInvokerService.java:145)
       at org.jboss.portal.portlet.federation.impl.FederatingPortletInvokerService.invoke(FederatingPortletInvokerService.java:149)
       at org.jboss.portal.core.model.instance.InstanceInvoker.invoke(InstanceInvoker.java:42)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.aspects.portlet.PortalSessionSynchronizationInterceptor.invoke(PortalSessionSynchronizationInterceptor.java:93)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.core.model.instance.InstanceSecurityInterceptor.invoke(InstanceSecurityInterceptor.java:93)
       at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
       at org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor.invoke(ConsumerCacheInterceptor.java:162)
       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl.org$jboss$portal$core$impl$model$instance$InstanceContainerImpl$invoke$aop(InstanceContainerImpl.java:408)
       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl.invoke(InstanceContainerImpl.java)
       at org.jboss.portal.core.impl.model.instance.AbstractInstance.invoke(AbstractInstance.java:231)
       at org.jboss.portal.core.impl.model.content.InternalContentProvider.renderWindow(InternalContentProvider.java:294)
       at org.jboss.portal.core.model.portal.command.render.RenderWindowCommand.execute(RenderWindowCommand.java:100)
       at org.jboss.portal.core.controller.ControllerCommand$1.invoke(ControllerCommand.java:68)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
       at org.jboss.portal.core.aspects.controller.node.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:124)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.invoke(PageCustomizerInterceptor.java:134)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:78)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:81)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.BackwardCompatibilityInterceptor.invoke(BackwardCompatibilityInterceptor.java:48)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.ControlInterceptor.invoke(ControlInterceptor.java:56)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.NavigationalStateInterceptor.invoke(NavigationalStateInterceptor.java:42)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.controller.ajax.AjaxInterceptor.invoke(AjaxInterceptor.java:55)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.ResourceAcquisitionInterceptor.invoke(ResourceAcquisitionInterceptor.java:50)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
       at org.jboss.portal.core.controller.ControllerContext.execute(ControllerContext.java:134)
       at org.jboss.portal.core.model.portal.command.render.RenderWindowCommand.render(RenderWindowCommand.java:80)
       at org.jboss.portal.core.model.portal.command.render.RenderPageCommand.execute(RenderPageCommand.java:222)
       at org.jboss.portal.core.controller.ControllerCommand$1.invoke(ControllerCommand.java:68)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
       at org.jboss.portal.core.aspects.controller.node.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:124)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.invoke(PageCustomizerInterceptor.java:134)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:78)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:81)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.BackwardCompatibilityInterceptor.invoke(BackwardCompatibilityInterceptor.java:48)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.ControlInterceptor.invoke(ControlInterceptor.java:56)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.NavigationalStateInterceptor.invoke(NavigationalStateInterceptor.java:42)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.controller.ajax.AjaxInterceptor.invoke(AjaxInterceptor.java:55)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.ResourceAcquisitionInterceptor.invoke(ResourceAcquisitionInterceptor.java:50)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
       at org.jboss.portal.core.controller.ControllerContext.execute(ControllerContext.java:134)
       at org.jboss.portal.core.model.portal.PortalObjectResponseHandler.processCommandResponse(PortalObjectResponseHandler.java:80)
       at org.jboss.portal.core.controller.classic.ClassicResponseHandler.processHandlers(ClassicResponseHandler.java:78)
       at org.jboss.portal.core.controller.classic.ClassicResponseHandler.processCommandResponse(ClassicResponseHandler.java:53)
       at org.jboss.portal.core.controller.handler.ResponseHandlerSelector.processCommandResponse(ResponseHandlerSelector.java:70)
       at org.jboss.portal.core.controller.Controller.processCommandResponse(Controller.java:315)
       at org.jboss.portal.core.controller.Controller.processCommand(Controller.java:303)
       at org.jboss.portal.core.controller.Controller.handle(Controller.java:261)
       at org.jboss.portal.server.RequestControllerDispatcher.invoke(RequestControllerDispatcher.java:51)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
       at org.jboss.portal.core.cms.aspect.IdentityBindingInterceptor.invoke(IdentityBindingInterceptor.java:47)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:68)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.server.PortalContextPathInterceptor.invoke(PortalContextPathInterceptor.java:45)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:96)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:196)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.server.aspects.server.SignOutInterceptor.invoke(SignOutInterceptor.java:98)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.impl.api.user.UserEventBridgeTriggerInterceptor.invoke(UserEventBridgeTriggerInterceptor.java:65)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.server.IdentityCacheInterceptor.invoke(IdentityCacheInterceptor.java:68)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.server.TransactionInterceptor.org$jboss$portal$core$aspects$server$TransactionInterceptor$invoke$aop(TransactionInterceptor.java:49)
       at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:253)
       at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:262)
       at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
       at org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.server.aspects.LockInterceptor$InternalLock.invoke(LockInterceptor.java:69)
       at org.jboss.portal.server.aspects.LockInterceptor.invoke(LockInterceptor.java:130)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
       at org.jboss.portal.server.servlet.PortalServlet.service(PortalServlet.java:252)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       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:182)
       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:619)
      Caused by: javax.ejb.NoSuchEJBException: Could not find stateful bean: a76q50-1hd169-g0gt4d5i-1-g0gt63il-o
       at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
       at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
       at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
       at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
       at $Proxy416.beforeTransactionCommit(Unknown Source)
       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:597)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
       at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
       at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
       at org.javassist.tmp.java.lang.Object_$$_javassist_seam_1.beforeTransactionCommit(Object_$$_javassist_seam_1.java)
       at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:49)
       at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:613)
       ... 241 more
      17:31:17,859 WARN [Component] Exception calling stateful session bean default @Remove method: org.jboss.seam.transaction.synchronizations
      javax.ejb.NoSuchEJBException: Could not find stateful bean: a76q50-1hd169-g0gt4d5i-1-g0gt63il-o
       at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
       at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
      


      Seam to be quite similar to:

      http://jira.icefaces.org/browse/ICE-3617?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel

      They have fixed it, interesting remark:
      It makes sense to me that establishing the view means that we have a new BridgeExternalContext (since the threads must be clean or closed from previous tx before another tx can be assigned to them and this is the nature of the exception).
      [ Show » ]
      Judy Guglielmin added a comment - 23/Oct/08 10:48 AM This one is back to you for 1.8 (trunk) now Mircea. It makes sense to me that establishing the view means that we have a new BridgeExternalContext (since the threads must be clean or closed from previous tx before another tx can be assigned to them and this is the nature of the exception).


      Does this make any sense to you?


      The application runs just fine as webapp (not as portlet).


      Best regards,
      André

        • 1. Re: ejb-transaction in seam
          andre.pankraz

          Even if i deactivate ejb-transaction, i have severe problems running simple CRUD-applications generated with seamgen.

          The portlet renders correctly, and basic submit operations work just fine, but if i use "done" or "sort column" or something like that, i get a

          Caused by: java.lang.IllegalStateException: EntityManager is closed
           at org.hibernate.ejb.EntityManagerImpl.getSession(EntityManagerImpl.java:66)
          



          This code is strange for me:

          SeamPhaseListenerWrapper:
          if (phaseId == RENDER_RESPONSE) {
           // writeConversationIdToResponse(
           // facesContext.getExternalContext().getResponse() );
           _defaultListener.afterRenderResponse(facesContext);
           } else if (Bridge.PortletPhase.ACTION_PHASE.equals(portletPhase)
           && (phaseId == INVOKE_APPLICATION
           || facesContext.getRenderResponse() || facesContext
           .getResponseComplete())) {
          // Manager manager = Manager.instance();
          // manager.beforeRedirect();
           // save Seam conversation Id.
           PortletBridgeContext bridgeContext = (PortletBridgeContext) facesContext
           .getExternalContext().getRequestMap().get(
           PortletBridgeContext.REQUEST_PARAMETER_NAME);
           if (null != bridgeContext) {
           BridgeRequestScope windowState = bridgeContext.getRequestScope();
           windowState.saveSeamConversationId(facesContext);
           }
           _defaultListener.afterResponseComplete(facesContext);
           }
          


          facesContext.getRenderResponse() is true, even in portletPhase ACTION_PHASE and phaseId RESTORE_VIEW.

          -> so _defaultListener.afterResponseComplete(facesContext) is called, which in turn calls SeamPhaseListener.afterResponseComplete -> FacesLifecycle.endRequest -> Contexts.flush -> ... -> EntityManagerImpl.close()

          This cannot be the correct?!


          Maybe the ejb-transaction problem concerning the EjbSynchronizations Seam component has the same problem and forgets the Stateful Component because it is in the EVENT context, which is discarded after ACTION_PHASE/RESTORE_VIEW?!

          @Stateful
          @Name("org.jboss.seam.transaction.synchronizations")
          @Scope(ScopeType.EVENT)
          @Install(precedence=FRAMEWORK, dependencies="org.jboss.seam.transaction.ejbTransaction")
          @BypassInterceptors
          @TransactionAttribute(TransactionAttributeType.SUPPORTS)
          public class EjbSynchronizations implements LocalEjbSynchronizations, SessionSynchronization
          


          • 2. Re: ejb-transaction in seam
            andre.pankraz

            Hi,

            After further investigations i would think, the problem is the division in the portlet process- and render-phase and the mapping to the JSF lifecycle and Seam-Contexts.


            After the process-portlet-phase all Seam-Scopes "Event" and "Conversation" (Not long-running) are destroyed.

            All EntityManagers or Statefull EJBs boud to this Contexts are closed too in this phase, so the caching of this context data doesn't make any sense.
            The following request shows problems like "EntityManager is closed" or "Cannot find Stateful bean" and so on.


            The Seam booking example does only work, because there isn't used the Seam managed Persistence Context (Short Conversation) and because luckily all Event-Context-bound Statefull Session Beans (quite common objects in Seam Apps, even in Seam Booking, see e.g. Register, ChangePass, removed ejb-transaction-tag...)
            Lots of luck...

            seamgen-Projects don't work, because the EntityManager is Seam-managed and hence Short Conversation -> close between Portlet Phases.


            I wouldn't speak of Seam support with this severe restrictions. I wouldn't find any Seam app working out of the Box.




            ScopyTypes:

            /**
            * The event (request) context. Spans a server request,
            * from restore view to render response.
            */
            EVENT,


            7.1. Seam's conversation model
            The examples we have seen so far make use of a very simple conversation model that follows
            these rules:
            • There is always a conversation context active during the apply request values, process
            validations, update model values, invoke application and render response phases of the JSF
            request lifecycle.
            • At the end of the restore view phase of the JSF request lifecycle, Seam attempts to restore
            any previous long-running conversation context. If none exists, Seam creates a new temporary
            conversation context.
            • When an @Begin method is encountered, the temporary conversation context is promoted to
            a long running conversation.
            • When an @End method is encountered, any long-running conversation context is demoted to
            a temporary conversation.
            • At the end of the render response phase of the JSF request lifecycle, Seam stores the contents
            of a long running conversation context or destroys the contents of a temporary conversation
            context.


            Both isn't fullfilled, isn't it?



            Is it a conceptional problem that cannot be solved? Isn't it possible, to remember the Contexts till the Render-Portlet-Phase without Contexts.flush?

            Sry speaking to myself, quite important problems for a project ;)


            Best Regards,
            André

            • 3. Re: ejb-transaction in seam
              andre.pankraz

              Small update here...with following change i can rescue short running conversations from ActionPhase to RenderPhase:

              In SeamPhaseListenerWrapper:

               private void afterPortletPhase(PhaseEvent event, FacesContext facesContext,
               PortletPhase portletPhase) {
              
               PhaseId phaseId = event.getPhaseId();
               if (phaseId == RESTORE_VIEW) {
               _defaultListener.afterRestoreView(facesContext);
               } else if (phaseId == INVOKE_APPLICATION) {
               _defaultListener.afterInvokeApplication();
               } else if (phaseId == PROCESS_VALIDATIONS) {
               _defaultListener.afterProcessValidations(facesContext);
               }
              
               FacesMessages.afterPhase();
              
               // delegate to subclass:
               _defaultListener.handleTransactionsAfterPhase(event);
              
               if (phaseId == RENDER_RESPONSE) {
               // writeConversationIdToResponse(
               // facesContext.getExternalContext().getResponse() );
               _defaultListener.afterRenderResponse(facesContext);
               } else if (Bridge.PortletPhase.ACTION_PHASE.equals(portletPhase)
               && (phaseId == INVOKE_APPLICATION
               || facesContext.getRenderResponse() || facesContext
               .getResponseComplete())) {
               if (!facesContext.getResponseComplete()) {
               Manager manager = Manager.instance();
               manager.beforeRedirect(); // make temporarily long running
               // TODO problem with portlets that will not be rendered
               // later, e.g. one is maximized on page
               // TODO rescue Event context too, e.g. set an empty one!
               }
               // save Seam conversation Id.
               PortletBridgeContext bridgeContext = (PortletBridgeContext) facesContext
               .getExternalContext().getRequestMap().get(
               PortletBridgeContext.REQUEST_PARAMETER_NAME);
               if (null != bridgeContext) {
               BridgeRequestScope windowState = bridgeContext.getRequestScope();
               windowState.saveSeamConversationId(facesContext);
               }
               _defaultListener.afterResponseComplete(facesContext);
               }
              
               }
              


              After "if (!facesContext.getResponseComplete()) {"...


              I have found this patch after comparing Submits (that work) and Action Requests (that don't).
              As far i see...this was included in the code (i only added responseComplete check) and has been removed later. Why?

              Because sometimes the render phase will never be called (e.g. one portlet maximized)?! But than i get a conversation timeout later...i like a very important working Seam feature more than this.

              Where are the problems? Can i rescue the Event context too through setting it to an empty one and hiding access to Request-Attributes for the Context cleanup?


              The short running conversational context is important, because this is Seams Anti-LazyLoading solution - without it Seam will lose one of it's most important features. A working solution would be very important! I don't know what my mini patch is breaking...

              The event context is important too, because of Stateful Session beans, which hold state for the whole JSF lifecycle - we all know how often JSF is calling getter functions in each Life Cycle phase.

              Some central Seam beans are SFSBs in Event context too...


              Best regards,
              André

              • 4. Re: ejb-transaction in seam
                andre.pankraz

                Hi,

                sry speaking to myself.

                With this hacks i can use temporary conversation contexts (e.g. seam managed persistence context and hence easy Seam-gen Portlets) and i can use event contexts with desctructable beans (e.g. stateful session beans like EJBSynchronization, activated with <transaction:ejb-transaction />).

                What does "use" mean? the event context lives from restore view till render response, beans will not be destroyed. the temporary conversation context is also saved through the portlet process -> render step.


                Both are major seam features and should be addressed by experts. my fix is really only a hack. I think, there are some additional problems in your bridge. E.g. why are all beans saved between different render phases of same portlet (see my hack, prevents it, but only for Seam)? This is not necessary, isn't it? A major memory waste and with potentially destructed beans as well. Shouldn't the event context bind to the Portlet Render Attributes? Why bind it to the Request Attributes and preserveActionAttributes, should be easier...

                I don't even dare to check the page context...don't need it so often.

                Plz, reevaluate your Seam support. It's very important and without functioning contexts it's really only an empty whitepaper statement.
                There are a lot of JSF Portlet Bridges on the market, but your remarkable support for such a mature webframework is really your special feature.

                If you think, there isn't a good solution (e.g. may be i have memory leaks), than you should address it in the documentation as restrictions.


                Best Regards,
                André

                 private void afterPortletPhase(PhaseEvent event, FacesContext facesContext,
                 PortletPhase portletPhase) {
                
                 PhaseId phaseId = event.getPhaseId();
                 if (phaseId == RESTORE_VIEW) {
                 _defaultListener.afterRestoreView(facesContext);
                 } else if (phaseId == INVOKE_APPLICATION) {
                 _defaultListener.afterInvokeApplication();
                 } else if (phaseId == PROCESS_VALIDATIONS) {
                 _defaultListener.afterProcessValidations(facesContext);
                 }
                
                 FacesMessages.afterPhase();
                
                 // delegate to subclass:
                 _defaultListener.handleTransactionsAfterPhase(event);
                
                 if (phaseId == RENDER_RESPONSE) {
                 // writeConversationIdToResponse(
                 // facesContext.getExternalContext().getResponse() );
                 _defaultListener.afterRenderResponse(facesContext);
                
                 // fix for destroyed event context beans:
                 // BridgeRequestScope.saveBeans() and .restoreBeans() remembers
                 // attributes for ACTION_PHASE -> RENDER_PHASE; but should not
                 // remember beans for RENDER_PHASE -> next RENDER_PHASE?!
                 PortletBridgeContext bridgeContext = (PortletBridgeContext) facesContext
                 .getExternalContext().getRequestMap().get(
                 PortletBridgeContext.REQUEST_PARAMETER_NAME);
                 if (null != bridgeContext) {
                 BridgeRequestScope windowState = bridgeContext
                 .getRequestScope();
                 try {
                 windowState.saveBeans(null);
                 } catch (final Exception e) {
                 // ignore
                 }
                 }
                
                 } else if (Bridge.PortletPhase.ACTION_PHASE.equals(portletPhase)
                 && (phaseId == INVOKE_APPLICATION
                 || facesContext.getRenderResponse() || facesContext
                 .getResponseComplete())) {
                
                 if (!facesContext.getResponseComplete()) {
                 Manager.instance().beforeRedirect();
                 }
                 // save Seam conversation Id.
                 PortletBridgeContext bridgeContext = (PortletBridgeContext) facesContext
                 .getExternalContext().getRequestMap().get(
                 PortletBridgeContext.REQUEST_PARAMETER_NAME);
                 if (null != bridgeContext) {
                 BridgeRequestScope windowState = bridgeContext
                 .getRequestScope();
                 windowState.saveSeamConversationId(facesContext);
                 }
                
                 // fix for destroyed event context beans:
                 // prevent destruction if response not complete for RENDER_PHASE,
                 // clear event context (but Seam Manager is needed!)
                 final Context eventContext = Contexts.getEventContext();
                 final Map<String, Object> eventComps = new HashMap<String, Object>();
                 if (!facesContext.getResponseComplete()) {
                 for (final String name : eventContext.getNames()) {
                 if ("org.jboss.seam.core.manager".equals(name))
                 continue;
                 final Object object = eventContext.get(name);
                 eventComps.put(name, object);
                 eventContext.remove(name);
                 }
                 }
                
                 _defaultListener.afterResponseComplete(facesContext);
                
                 // fix for destroyed event context beans:
                 // refill event context
                 for (final Map.Entry<String, Object> entry : eventComps.entrySet())
                 eventContext.set(entry.getKey(), entry.getValue());
                 }
                
                 }
                


                • 5. Re: ejb-transaction in seam
                  wesleyhales

                  You are not only speaking to yourself ;)
                  Thanks for the post, we will check into it.

                  • 6. Re: ejb-transaction in seam
                    michaelschuetz

                    I'm facing the same problem. What's the current status on integrating GateIn and Seam? Is this ejb-transaction workaround the official recommended way to do so? Is this seen as JIRA issues?

                     

                     

                    Thanks a lot
                    Michael

                    • 7. Re: ejb-transaction in seam
                      michaelschuetz

                      There is a JIRA issue now: https://issues.jboss.org/browse/PBR-242

                       

                      Really appreciate any help as this a show stopping issue.

                       

                       

                      Cheers

                      Michael

                      • 8. ejb-transaction in seam
                        jjamrich

                        Hi Michael,

                        could you describe your problem/environment bit more? There were some newer versions of PBR released as well as newer version of JBoss Portal - GateIn is out right now.

                        According to JIRA PBR-242 you had mentioned there is difference between environment in issue described above (JBoss Portal 2.7.2 vs. GateIn-3.1.0.GA) and this JIRA.

                         

                        Currently, when I uncomment <transaction:ejb-transaction/> in SeamBooking demo (http://anonsvn.jboss.org/repos/portletbridge/tags/2.1.0.FINAL/examples/seam/booking/), no such exception appear.

                         

                        Thanks

                        JJa

                        • 9. ejb-transaction in seam
                          jjamrich

                          Have to correct myself.

                          When uncomment <transaction:ejb-transaction/> from components.xml in SeamBooking Demo, I get exception mentioned in JIRA https://issues.jboss.org/browse/PBR-242).

                          So, this issue could be still reproduced. I'll comment on this JIRA.

                          • 10. Re: ejb-transaction in seam
                            yhawari

                            i also encountered this. anyone made an advancement on this i will greatly appreciate sharing ur knowledge.

                            • 11. ejb-transaction in seam
                              yhawari

                              Dear Wesley, you profesional comment on André Pankraz patch is of great assisstance to us. what is wrong with his path?. appreciate ur feedback.

                              • 12. Re: ejb-transaction in seam
                                andre.pankraz

                                I updated my solution for PortletBridge 2.1.0.FINAL:

                                 

                                In SeamStrategy.java i use this addition, this prevents callouts to @Remove in SFSBs in Event/Conversation-Contexts between ActionRequest and RenderRequest (without RenderComplete).

                                This is important for EjbSynchronizations (Event) and Seam-managed EntityManager (temp. Comversation)!

                                 

                                Attention: Component-Add/Remove-Events are triggered, i could directly change request.attributes-map or overload seam-classes, was the easiest solution for me:

                                 

                                 

                                    @Override

                                    public void afterActionRequest(final FacesContext facesContext) {

                                        super.afterActionRequest(facesContext);

                                        this.seamListenerWrapper.saveFacesMessages(facesContext);

                                 

                                        // fix for destroyed event / conversation context beans:

                                        // prevent destruction if response not complete for RENDER_PHASE,

                                        // clear context (but Seam Manager is needed!)

                                        final Context eventContext = Contexts.getEventContext();

                                        final Map<String, Object> eventComps = new HashMap<String, Object>();

                                        if (!facesContext.getResponseComplete()) {

                                            for (final String name : eventContext.getNames()) {

                                                if ("org.jboss.seam.core.manager".equals(name)) {

                                                    continue;

                                                }

                                                final Object object = eventContext.get(name);

                                                eventComps.put(name, object);

                                                eventContext.remove(name);

                                            }

                                        }

                                        final Context convContext = Contexts.getConversationContext();

                                        final Map<String, Object> convComps = new HashMap<String, Object>();

                                        if (!facesContext.getResponseComplete()) {

                                            for (final String name : convContext.getNames()) {

                                                final Object object = convContext.get(name);

                                                convComps.put(name, object);

                                                convContext.remove(name);

                                            }

                                        }

                                 

                                        this.seamListenerWrapper.finishRequest(facesContext);

                                 

                                        // fix for destroyed event / conversation context beans:

                                        // refill context

                                        for (final Map.Entry<String, Object> entry : convComps.entrySet()) {

                                            convContext.set(entry.getKey(), entry.getValue());

                                        }

                                        for (final Map.Entry<String, Object> entry : eventComps.entrySet()) {

                                            eventContext.set(entry.getKey(), entry.getValue());

                                        }

                                    }