1 Reply Latest reply on Jul 6, 2009 8:42 PM by Jean Luc

    Application scoped beans and SFSB timeout

    Marcus Schmidke Newbie

      Hello all,


      from time to time I get a Could not find stateful bean error message when I log into my application.


      I figured out that this error is caused by the access to a Application scoped Seam component when the application wasn't used for a certain amount of time.


      Obviously, the container removed the SFSB due to inactivity, and on the next request, Seam still thinks the Bean should be available (since it is application scoped).


      How can I get around with this?


      As a first approach, I added a CacheConfig annotation to my bean:




      @Stateful
      @CacheConfig(removalTimeoutSeconds = 0, idleTimeoutSeconds = 0)
      @Name("appglobal")
      @Scope(ScopeType.APPLICATION)
      @AutoCreate
      public class WebAppGlobalImpl implements WebAppGlobal {
      


      Hoping that 0 means no timeout (did not find documentation on this). It seems to work, but it's kind of workaround.


      What is the right way?


      Marcus.