10 Replies Latest reply on Nov 25, 2010 9:31 AM by michaelschuetz

    Seam session outlives the GateIn session

      I have created a very simple portlet containing a seam bean that supplies credentials for the current user.

       

      The portlet was created by using a maven archetype:

       

      mvn archetype:generate -DarchetypeGroupId=org.jboss.portletbridge.archetypes -DarchetypeArtifactId=seam-basic -DarchetypeVersion=2.0.0.CR1 -DgroupId=simple -DartifactId=Simple -DarchetypeRepository=http://repository.jboss.org/maven2/

       

      GateIn version: 3.0.0-GA

      PortletBridge version: 2.0.0.CR1

       

      My problem is that when I sign out of GateIn my seam session survives,  and when I sign in as a new user, I still get the username of the previous  user. I thought that the portlet bridge would end my seam session when I sign out of the portal and thereby killing my currentUser bean?

       

      What is the correct approach to handling GateIn login/logout in my portlet? Any help will be appreciated

       

      Code for currentUser bean is attached.

        • 1. Re: Seam session outlives the GateIn session
          rafaelliu

          Seems like a portal issue. The session that Seam sees is the Portlet Session (JBoss Portlet Bridge does this conversion), and apearently the Portlet Session invalidation isn't invalidating Portlet Sessions as it should.

           

          Please, file a JIRA.

          • 2. Re: Seam session outlives the GateIn session

            Thank you for the quick reply.

             

            That was the behaviour I expected i.e. that the bridge would take care of the session. But does it nessesarily point at a portal problem, could it not be the portlet bridge having an issue with handling the conversion from Portlet Session to Seam Session?

             

            Any ideas for a quick test that could isolate the problem?

            • 3. Re: Seam session outlives the GateIn session
              theute

              If webapp session dies, the portlet session dies with it (portlet session is just reusing the webapp session).

               

              The issue here is that when the session of the portal webapp dies, the sessions of the portlets webapp can't know. It's not just about Seam.

               

              We had a workaround in JBoss Portal that was working pretty well, would need to be ported to GateIn. Can you open a Jira ? And if you feel fancy, would you like to try to port that feature ?

              • 4. Re: Seam session outlives the GateIn session

                Thank you Thomas Heute - that properly saved me some hours of debugging

                 

                I have created a new Jira bug report :  https://jira.jboss.org/browse/GTNPORTAL-1257

                 

                Are you able to estimate when the workaround from Jboss Portal could be included in a GateIn release? Are there any 'elegant' ways to handle this issue until a fix has been included?

                • 5. Re: Seam session outlives the GateIn session
                  michaelschuetz

                  Are you able to estimate when the workaround from Jboss Portal could be included in a GateIn release? Are there any 'elegant' ways to handle this issue until a fix has been included?

                  I'm facing the same problem. Are there any news on this? Would appreciate hint for working around this issue.

                   

                   

                  Cheers

                  Michael

                  • 6. Re: Seam session outlives the GateIn session
                    theute

                    It's actually resolved (Jira status was wrong) and will be included in GateIn 3.2 and EPP 5.1.

                     

                    EPP 5.1 is scheduled for December, while we didn't define a date for GateIn 3.2 yet (still working on some feature requests). If you build GateIn from trunk you will have the feature.

                    • 7. Re: Seam session outlives the GateIn session
                      michaelschuetz

                      Thomas, thanks for this update. BTW, will GateIn 3.2 run on AS 6 out of the box?

                       

                      Thanks

                      Michael

                      • 8. Re: Seam session outlives the GateIn session
                        theute

                        It's actually one of the thing we are looking at (I would like to have it), but as you know AS6 is in milestone phase and the classloading behavior has changed. So maybe we can have some kind of "preview". Any help is welcome

                         

                        Tomcat 7 should also be available as a package.

                        • 9. Re: Seam session outlives the GateIn session
                          michaelschuetz

                          If you build GateIn from trunk you will have the feature.

                          I am interested in implementation details, if you don't mind. Which class would I need to look at in trunk?

                          As I do need release for my productional system, I would like to implement your fix for my own - until GateIn 3.2 has been released.

                           

                          My guess is sth like performing this on logout:

                           

                           

                          {code}

                          WebAppController controller = (WebAppController)container.getComponentInstanceOfType(WebAppController.class);

                                   PortalApplication portalApp = controller.getApplication(PortalApplication.PORTAL_APPLICATION_ID);

                                   portalApp.getStateManager().expire(event.getSession().getId(), portalApp);

                           

                          {code}

                           

                          Right direction?

                           

                           

                          Thanks

                          Michael

                          • 10. Re: Seam session outlives the GateIn session
                            michaelschuetz
                            So maybe we can have some kind of "preview". Any help is welcome

                             

                            Cool - would love to help. Started new thread for this: http://community.jboss.org/thread/159308