1 Reply Latest reply on Jul 6, 2012 2:34 AM by mahadev_sawale

    Session Scope (war project without EJB) bean does not replicate but @Stateful (Ear project with EJB)

    mahadev_sawale

      Hi,

      I have a seam web application(war project) with one session scoped bean:

      @Name("crudAction")
      @Scope(ScopeType.SESSION)
      public class CrudActionBean implements Serializable{
           private String msg; //with getter and setter methods
            public String crudAction(){
                 msg= "Content to be displayed on crudAction page after this action"; // this will be displyed in <h:outputText../> on crudAction page.
            return "/crudAction.xhtml";
            }
      }

      web.xml has <distributable/> tag defined.
      components.xml has distributable="true" defined in <core:init.../> tag.
      I am using Seam 2.2, Jboss 5.1 server and JDK 1.6 and Windows XP OS.

       

      After killing jboss of node1, if I try to reload page or do some action, I get following error message on jboss console of node2:

      And does not replicate session.

       

      ClassNotFoundException occurred unmarshalling value java.lang.ClassNotFoundException: org.domain.seamdemo.session.CrudAction

       

      Detailed stack trace has been attached here with this post.

      But replication works successfully, if I try above by creating Ear project and modifying the bean to SFSB like:

       

      @Stateful
      @Name("crudAction")
      @Scope(ScopeType.SESSION)
      @Clustered
      public class CrudActionBean implements CrudAction,Serializable{ "same code as above"} //CrudAction is @Local interface.

       

      The value of msg variable were displyed even after realoding page.
      Can someone please help me for the above.
      Let me know if additional information is needed.

      Thanks.