4 Replies Latest reply on Jun 23, 2009 12:43 AM by billevans

    Shutting down JBoss - how long is Seam working?

    asiandub

      Hi there,


      consider the following scenario: JBoss is shutting down (controlled), existing web-sessions are destroyed, sessionDestroyed-event is raised, registered SessionListener is called.


      The following problem occurs: The Bijection-mechanism is not working (anymore?) if called from within this app-server-shutting-down scenario.



      15:34:35,053 INFO  [Server] Shutting down the server, blockingShutdown: false
      15:34:35,053 INFO  [Server] Server exit(0) called
      15:34:35,053 INFO  [Server] Runtime shutdown hook called, forceHalt: true
      15:34:35,053 INFO  [Server] JBoss SHUTDOWN: Undeploying all packages
      15:34:35,053 INFO  [TomcatDeployer] undeploy, ctxPath=/saporo-intranet, warUrl=.../deploy/saporo-intranet-ear.ear/saporo-intranet-war.war/
      15:34:35,069 ERROR [[/intranet]] Session event listener threw exception
      java.lang.NullPointerException
      



      Well, that's a bit of a hassle. The session does still exist, the required attributes (the user) is still set, the container just stopped inject the Home / List classes - which i need to persist the logout process.


      Any ideas? Workarounds? Help?


      Many thanks,


      Jan



        • 1. Re: Shutting down JBoss - how long is Seam working?
          asiandub

          solved the problem using the following snippet in my compontents.xml



               <event type="org.jboss.seam.preDestroyContext.SESSION">
                     <action execute="#{intranet.authenticator.logout}" />
                </event>
          



          but: should one of the enligthed read this - i'd really like to understand why the upper example is not working...


          cheers,


          jan

          • 2. Re: Shutting down JBoss - how long is Seam working?
            asiandub

            oddly, i can see from the logfiles, that the event (post 2) is raised after the code of post 1 is called.


            again: bijection is working in (2), but not in (1)...

            • 3. Re: Shutting down JBoss - how long is Seam working?
              asiandub

              i hate these 'me and myself' monologues in this forum...

              • 4. Re: Shutting down JBoss - how long is Seam working?
                billevans

                Hey, Jan!


                I also hate it when people don't take any interest in my questions....


                I know it is nearly 6 months later, but I have a similar problem to yours and wonder if you can help me! 


                First, though, I must thank you for pointing me to the <event> entry in components.xml. Very useful.


                Anyway, to my point.  Like you, I want to catch the JBoss shutdown sequence and logout all my users. However, I would also like the logout to cause their browser windows to get refreshed back to the login screen.  Now by using the RichFaces' component <a4j:push>, I can get asynchronous refreshes to happen but NOT in this instance, presumably because the Seam servlet has already shutdown.  Do you by any chance have knowledge of any other way to do this?


                NOTE: I'll understand if you don't bother responding as you got a very poor response yourself.


                Bill