0 Replies Latest reply on Mar 26, 2009 3:49 AM by Walter White

    no active event context

    Walter White Novice

      Hi all,


      I have tried several different methods to be able to save session information to a database (browser, logged in user, history, page generation time, etc.).  My first method was to use a Servlet Filter as a Seam component.  My second try was to use an event listener listening for seam events.  And lastly, I just implemented a ServletRequestListener.


      I think I have all of the bugs worked out, the closest I can get to the page being served up is:


      2009-03-25 22:40:26.670::WARN:  /contact.xhtml
      java.lang.IllegalStateException: No active event context
           at org.jboss.seam.core.Manager.instance(Manager.java:368)
           at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:55)
           at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
           at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:378)
           at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
           at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
           at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
           at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
           at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
           at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
           at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
           at org.mortbay.jetty.Server.handle(Server.java:324)
           at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
           at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
           at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
           at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
           at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
           at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
           at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
      



      In order to get this far, I had to wrap the request in a ContextualHttpServletRequest to get a hibernate session.


      The stack trace doesn't map back to any of my code unfortunately, so I cannot determine the exact cause.  My guess is that Seam destroys the context just before I make a call to hibernate to persist the session history.


      Any ideas as to how I can get this to work?


      Walter