12 Replies Latest reply on Sep 12, 2006 7:41 PM by andyd

    Seam + Portal

      I have taken the examples/registration application and tried to deploy it alongside portal. I am not even attempting to integrate until they can both live side-by-side with no problems, as JSF apps do with portal.

      One thing I have encountered which is likely the blocker is that JSF is registering two instances of the SeamPhaseListener.

      17:27:03,734 INFO [Initialization] done initializing Seam
      17:27:03,750 INFO [FacesConfigurator] Reading standard config org/apache/myfaces/resource/standard-faces-config.xml
      17:27:03,843 INFO [FacesConfigurator] Reading config jar:file:/C:/jboss-4.0.4RC1/server/default/tmp/deploy/tmp55542jboss-seam-registration.ear-contents/jboss-seam.jar!/META-INF/faces-config.xml
      17:27:03,843 INFO [FacesConfigurator] Reading config jar:file:/C:/jboss-4.0.4RC1/server/default/tmp/deploy/tmp55485jboss-portal.sar-contents/lib/jsf-facelets.jar!/META-INF/faces-config.xml
      17:27:03,843 INFO [FacesConfigurator] Reading config jar:file:/C:/jboss-4.0.4RC1/server/default/tmp/deploy/tmp55485jboss-portal.sar-contents/lib/tomahawk.jar!/META-INF/faces-config.xml
      17:27:03,890 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
      17:27:03,906 ERROR [LocaleUtils] Locale name null or empty, ignoring
      17:27:04,140 INFO [STDOUT] HI!
      17:27:04,140 INFO [StartupServletContextListener] ServletContext 'C:\jboss-4.0.4RC1\server\default\.\tmp\deploy\tmp55542jboss-seam-registration.ear-contents\jboss-seam-registration-exp.war\' initialized.
      17:27:04,203 INFO [FacesConfigurator] Reading standard config org/apache/myfaces/resource/standard-faces-config.xml
      17:27:04,281 INFO [FacesConfigurator] Reading config jar:file:/C:/jboss-4.0.4RC1/server/default/tmp/deploy/tmp55542jboss-seam-registration.ear-contents/jboss-seam.jar!/META-INF/faces-config.xml
      17:27:04,281 INFO [FacesConfigurator] Reading config jar:file:/C:/jboss-4.0.4RC1/server/default/tmp/deploy/tmp55485jboss-portal.sar-contents/lib/jsf-facelets.jar!/META-INF/faces-config.xml
      17:27:04,312 INFO [FacesConfigurator] Reading config jar:file:/C:/jboss-4.0.4RC1/server/default/tmp/deploy/tmp55485jboss-portal.sar-contents/lib/tomahawk.jar!/META-INF/faces-config.xml
      17:27:04,375 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
      17:27:04,375 ERROR [LocaleUtils] Locale name null or empty, ignoring
      17:27:04,375 INFO [RenderKitFactoryImpl] RenderKit with renderKitId 'HTML_BASIC' was replaced.
      17:27:04,375 INFO [STDOUT] HI!
      


      I added a constructor to org.jboss.seam.jsf.SeamPhaseListener, that prints out "HI!". As you can see, it hits it twice. I am not sure why however, but my guess is thats its inside an .ear? Can anyone shed light on this?

      There is a long history of multiple instances of the same phaselistener being registered (http://www.nabble.com/forum/Search.jtp?forum=181&local=y&query=listener+twice), but none of the cases are related to what I am seeing.

      Of course, the peculiar thing is that this does not occur, once you undeploy the portal.sar!

        • 1. Re: Seam + Portal
          hildolfur

          Try to get a stack trace inside of the constructor and print it to the console. Simply create a new Exception and call printStackTrace(), you don't even need to throw it. Maybe that will help to identify the calls...

          • 2. Re: Seam + Portal

            It is as I suspected that Tomcat deploys it the first time, and then the portal comes along and reads in the config again. This is normal and expected and happens with most JSF apps that have the portlet descriptors included.

            Normally, this is not a problem, but I suspect that having two SeamPhasListeners registered is indeed a causing issues on execute. As with the link I posted in the original post, theres usually not an issue with two instances of the same listener being registered, but Seam's case may differ.

            Now, taking Thomas' suggestions I did find a way to shortcircuit this behaviour, by commenting the myfaces StartupServletContextListener. Myfaces complains on deploy, but the seam app will still work outside of the portal with no problems.

            Inside of the portal, we fail:

            10:44:02,843 ERROR [MyFacesGenericPortlet] The portlet threw an exception
            java.lang.IllegalStateException: No active session context
             at org.jboss.seam.core.LocaleSelector.instance(LocaleSelector.java:119)
             at org.jboss.seam.jsf.SeamViewHandler.calculateLocale(SeamViewHandler.java:24)
             at org.apache.myfaces.application.jsp.JspViewHandlerImpl.createView(JspViewHandlerImpl.java:130)
             at org.jboss.seam.jsf.SeamViewHandler.createView(SeamViewHandler.java:35)
             at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:320)
             at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:298)
             at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:380)
             at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:266)
             at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:167)
             at javax.portlet.GenericPortlet.render(GenericPortlet.java:407)
             at org.jboss.portal.portlet.PortletContainer.invokeRender(PortletContainer.java:552)
             at org.jboss.portal.portlet.PortletContainer.dispatch(PortletContainer.java:464)
             at org.jboss.portal.server.app.ComponentInvocation.dispatch(ComponentInvocation.java:79)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:142)
             at org.jboss.portal.core.aspects.component.TransactionInterceptor.invoke(TransactionInterceptor.java:69)
             at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.core.aspects.component.HeaderInterceptor.invoke(HeaderInterceptor.java:48)
             at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.server.aspects.component.CacheInterceptor.invoke(CacheInterceptor.java:169)
             at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.server.aspects.component.ModesInterceptor.invoke(ModesInterceptor.java:86)
             at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.server.aspects.component.WindowStatesInterceptor.invoke(WindowStatesInterceptor.java:85)
             at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.portlet.aspects.component.SessionPostDispatchInterceptor.invoke(SessionPostDispatchInterceptor.java:82)
             at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.server.aspects.component.ContextDispatcherInterceptor$InvokeNextCommand.execute(ContextDispatcherInterceptor.java:127)
             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.portal.server.servlet.CommandServlet.doGet(CommandServlet.java:101)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
             at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:539)
             at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
             at org.jboss.portal.server.app.impl.AbstractRequestContext.include(AbstractRequestContext.java:247)
             at org.jboss.portal.server.aspects.component.ContextDispatcherInterceptor$1.include(ContextDispatcherInterceptor.java:71)
             at org.jboss.portal.server.servlet.CommandServlet.include(CommandServlet.java:81)
             at org.jboss.portal.server.aspects.component.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:77)
             at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.portlet.aspects.component.SessionPreDispatchInterceptor.invoke(SessionPreDispatchInterceptor.java:108)
             at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.server.aspects.component.ContextTrackerInterceptor.invoke(ContextTrackerInterceptor.java:47)
             at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.portlet.aspects.component.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:67)
             at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.portlet.aspects.component.ValveInterceptor.invoke(ValveInterceptor.java:62)
             at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:177)
             at org.jboss.portal.core.command.RenderWindowCommand.execute(RenderWindowCommand.java:110)
             at org.jboss.portal.core.command.ControllerCommand.dispatch(ControllerCommand.java:93)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:142)
             at org.jboss.portal.core.aspects.controller.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:84)
             at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.core.aspects.controller.PageNavigationInterceptor.invoke(PageNavigationInterceptor.java:77)
             at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:80)
             at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.core.aspects.controller.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:59)
             at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:177)
             at org.jboss.portal.core.command.CommandContext.execute(CommandContext.java:102)
             at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:91)
             at org.jboss.portal.core.command.CommandContext.chain(CommandContext.java:133)
             at org.jboss.portal.core.command.MarkupCommand.renderPortletWindow(MarkupCommand.java:386)
             at org.jboss.portal.core.command.RenderPageCommand.renderFragments(RenderPageCommand.java:77)
             at org.jboss.portal.core.command.MarkupCommand.execute(MarkupCommand.java:202)
             at org.jboss.portal.core.command.ControllerCommand.dispatch(ControllerCommand.java:93)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:142)
             at org.jboss.portal.core.aspects.controller.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:84)
             at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.core.aspects.controller.PageNavigationInterceptor.invoke(PageNavigationInterceptor.java:77)
             at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:80)
             at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.core.aspects.controller.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:59)
             at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:177)
             at org.jboss.portal.core.command.CommandContext.execute(CommandContext.java:102)
             at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:91)
             at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:78)
             at org.jboss.portal.core.CoreController.handle(CoreController.java:150)
             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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.JMXInvocationHandler.invoke(JMXInvocationHandler.java:287)
             at $Proxy151.handle(Unknown Source)
             at org.jboss.portal.server.ServerInvocation.dispatch(ServerInvocation.java:76)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:142)
             at org.jboss.portal.server.aspects.server.NavigationInterceptor.invoke(NavigationInterceptor.java:64)
             at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:65)
             at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:73)
             at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:226)
             at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.server.aspects.server.SessionInvalidatorInterceptor.invoke(SessionInvalidatorInterceptor.java:84)
             at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
             at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.server.aspects.server.ParametersInterceptor.invoke(ParametersInterceptor.java:107)
             at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
             at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:132)
             at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:177)
             at org.jboss.portal.server.servlet.PortalServlet.doGet(PortalServlet.java:228)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
             at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
             at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
             at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
             at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
             at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
             at java.lang.Thread.run(Thread.java:595)
            


            More info as I debug further...

            • 3. Re: Seam + Portal

              I have modified the SeamPhaseListener so every phase is entered only once by adding a ThreadLocal innerclass to preserve order and ignore dupe calls. So no need to uncomment the StartupServletContextblabla anymore - as it leads to an ugly trace on deploy anyway.

              Now, that allows everything to work nicely outside of the portal, when deployed alongside the portal. However, inside the portal, it is still failing and it appears all context objects are null:

              13:43:28,609 ERROR [MyFacesGenericPortlet] The portlet threw an exception
              java.lang.IllegalStateException: No active session context
               at org.jboss.seam.core.LocaleSelector.instance(LocaleSelector.java:119)
               at org.jboss.seam.jsf.SeamViewHandler.calculateLocale(SeamViewHandler.java:24)
               at org.apache.myfaces.application.jsp.JspViewHandlerImpl.createView(JspViewHandlerImpl.java:130)
               at org.jboss.seam.jsf.SeamViewHandler.createView(SeamViewHandler.java:35)
               at org.jboss.seam.jsf.SeamViewHandler.createView(SeamViewHandler.java:35)
               at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:320)
               at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:298)
               at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:380)
               at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:266)
               at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:167)
               at javax.portlet.GenericPortlet.render(GenericPortlet.java:407)
              


              This is hapenning after the portal dispatched to myfacesportlet. Tracing the code, I see all context objects are null. The SeamPhaseListener is never hit, nor is the contexts.Lifecycle class.

              Obviously I'm missing some data on how Seam handles its context creation, and why inside a portal environment all of it is nulled. I was thinking it was the portal's redirect response, but it appears that not even the initial request is being processed correctly in Seam.

              • 4. Re: Seam + Portal

                Mr. Russo,

                Is there a branch available for your change to Seam ? I'd like to recreate your work and assist the investigation if possible.

                Colin

                • 5. Re: Seam + Portal

                  I will be showing Gavin what I have done, tomorrow. Then he can decide whether we roll the changes in to Seam or create a separate branch. I will update this post, once the decision has been made.

                  I look forward to any help I can get from you in this. ;-)

                  • 6. Re: Seam + Portal

                    Guys - the latest HEAD build I did has a dependency on portlet-api-lib.jar as it checks whether it is writing a portlet or servlet response (code to write conversation id in response).

                    Looks like some good progress is being made in getting Seam and Portal to well together. All I can say is thank you.

                    But I do have a couple of questions:

                    - is portlet-api-lib.jar supposed to be packaged with or Seam applications ? Is it a prerequisite of the container ?

                    I ask because I can't seem to get the classloader to pick it up when I package it in WEB-INF/lib of my Seam WAR file.

                    My second question is - how can I help ?

                    • 7. Re: Seam + Portal

                      Guys,

                      It seems that Portal's requests don't go through the org.jboss.seam.contexts.Lifecycle.class's beginRequest method.

                      As a result, none of Seam's TLS caches get initialized with contexts. I don't know if this is a dependency on JSF that isn't compatible with JSR-168 (i.e. should this lifecycle processing happen in a portal ?)

                      At any rate - Assuming I can find a portlet hook to do this initialization on, should I continue with this or do we know already that the Portal will not provide enough info to initialize the caches ?

                      • 8. Re: Seam + Portal

                        Actually,

                        Here is some more details - it looks like the SeamPhaseListener doesn't get called for RESTORE_VIEW in the portlet case.

                        It goes straight to RENDER_RESPONSE in portlet, but always through RESTORE_VIEW in the regular web page case.

                        Is there similar behavior for the JSF based admin pages ? Is this a bug in MyFacesGenericPortlet ?

                        • 9. Re: Seam + Portal
                          gavin.king

                          I just committed working portal support on Sunday eve. It is not yet documented.

                          You have to use SeamPortletPhaseListener, not SeamPhaseListener to account for the differences in the JSF request lifecycle in a portal.

                          • 10. Re: Seam + Portal

                            I have committed the docs on how to deploy the example.

                            Important to note my comments on the manual configuration needed after using the installer: http://jira.jboss.com/jira/browse/JBAS-3069

                            This issue is being addressed.

                            • 11. Re: Seam + Portal
                              andyd

                              Guys,
                              I have been working with this for a few days to try and get it working. I have added portlet config files to the seam blog example to try and simulate the set up that I was hoping to use for a project. Have installed using the 1.2.0BETA JbossAS installer and selected the Portal profile.

                              I have had the seam 1.0.1GA portal example working fine. However I am getting problems when trying to move to the seam + portlet + ejb3 + facelets in an EAR config.

                              Does anyone have a working example of this setup? Am I doing something that won't work? Can post added configs if it will help.

                              Andy.

                              I see this [org.jboss.seam.jsf.AbstractSeamPhaseListener] There should only be one Seam phase listener per application


                              and a little later

                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 14)
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.SQL] update HitCount set pageviews=? where blog_name=?
                              2006-09-13 00:20:06,856 INFO [STDOUT] Hibernate: update HitCount set pageviews=? where blog_name=?
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.cache.NonstrictReadWriteCache] Invalidating: domain.HitCount#JBoss Seam Blog
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.AbstractBatcher] Executing batch size: 1
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 15)
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.ConnectionManager] skipping aggressive-release due to flush cycle
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 14) (open ResultSets: 0, globally: 0)]
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.cache.NonstrictReadWriteCache] Invalidating (again): domain.HitCount#JBoss Seam Blog
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.cache.UpdateTimestampsCache] Invalidating space [HitCount], timestamp: 4743590735282177
                              2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
                              2006-09-13 00:20:06,856 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                              2006-09-13 00:20:06,856 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] beginning transaction prior to phase: INVOKE_APPLICATION(5)
                              2006-09-13 00:20:06,856 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                              2006-09-13 00:20:06,856 DEBUG [org.jboss.seam.Component] instantiating Seam component: facesMessages
                              2006-09-13 00:20:06,856 DEBUG [org.jboss.seam.Component] initializing new instance of: facesMessages
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] committing transaction after phase: RENDER_RESPONSE(6)
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.security.authenticator
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: javax.portlet.userinfo
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: THEME
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.portal.attribute.component_invocation
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: javax.portlet.request
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: javax.portlet.response
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.catalina.NAMED
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: THEMERESULT
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: javax.portlet.config
                              2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation context
                              2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Contexts] destroying: facesMessages
                              2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Contexts] destroying: entityManager
                              2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.core.ManagedPersistenceContext] destroying seam managed persistence context for persistence unit: java:/blogEntityManagerFactory
                              2006-09-13 00:20:06,946 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
                              2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Contexts] destroying: conversation
                              2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing server-side conversation context
                              2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
                              2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                              2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                              2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
                              2006-09-13 00:20:06,946 ERROR [org.apache.myfaces.portlet.MyFacesGenericPortlet] The portlet threw an exception
                              java.lang.IllegalStateException: No active session context
                              at org.jboss.seam.Seam.isSessionInvalid(Seam.java:176)
                              at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:264)
                              at org.jboss.seam.jsf.SeamPortletPhaseListener.afterPhase(SeamPortletPhaseListener.java:99)
                              at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter(LifecycleImpl.java:536)
                              at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:359)
                              at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:323)
                              at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:298)
                              at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:380)
                              at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:266)
                              at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:167)
                              at javax.portlet.GenericPortlet.render(GenericPortlet.java:407)
                              at org.jboss.portal.portlet.container.PortletContainer.invokeRender(PortletContainer.java:561)
                              at org.jboss.portal.portlet.container.PortletContainer.dispatch(PortletContainer.java:482)
                              at org.jboss.portal.portlet.container.PortletContainerInvoker$1.dispatch(PortletContainerInvoker.java:138)
                              at org.jboss.portal.portlet.invocation.PortletInvocation.dispatch(PortletInvocation.java:242)
                              at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140)
                              at org.jboss.portal.core.aspects.component.TransactionInterceptor.invoke(TransactionInterceptor.java:69)
                              at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
                              at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
                              at org.jboss.portal.core.aspects.component.HeaderInterceptor.invoke(HeaderInterceptor.java:50)

                              • 12. Re: Seam + Portal
                                andyd

                                Just to add, I am using the Portlet version of the PhaseListener

                                Andy.