2 Replies Latest reply on Oct 19, 2009 1:38 AM by Huy Le

    AbstractConversationManager is not serializable

    Huy Le Newbie

      Hi,


      I just tried deploying WELD 1.0 CR1 to Google App Engine and got the following exception due to the fact that the session scoped ServletConversationManager references instances of type ConversationEntry which is not serializable:




      java.lang.RuntimeException: java.io.NotSerializableException: org.jboss.weld.conversation.ConversationEntry
           at com.google.apphosting.runtime.jetty.SessionManager.serialize(SessionManager.java:361)
           at com.google.apphosting.runtime.jetty.SessionManager.createEntityForSession(SessionManager.java:341)
           at com.google.apphosting.runtime.jetty.SessionManager$AppEngineSession.save(SessionManager.java:162)
           at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:41)
           at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
           at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
           at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
           at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
           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:712)
           at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
           at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
           at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
           at org.mortbay.jetty.Server.handle(Server.java:313)
           at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
           at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
           at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
           at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
           at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
           at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:239)
           at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5135)





      I basically used a modified numberguess example, similar to wiki://100596, and had to provide a temporary @Alternative for ServletConversationManager with the following to work around the issue reported in that forum post:




      @Override
      public BeanStore getBeanStore(String cid) {
           return new ConversationBeanStore(((HttpServletRequest) FacesContext
                     .getCurrentInstance().getExternalContext().getRequest())
                     .getSession(), cid);
      }