5 Replies Latest reply on Feb 21, 2011 4:17 AM by ivan.tufegdzic

    Component class should be serializable meaning

      Hello,


      I have very simple component which is used in order to retrieve current user. Its code is very simple:


      package myApp.web.profile;
      
      import org.jboss.seam.Component;
      ... other Seam imports ...
      import org.jboss.seam.security.management.JpaIdentityStore;
      
      import myApp.core.entity.auth.MyAppUser;
      
      @Name("currentUser")
      @AutoCreate
      @Scope(ScopeType.SESSION)
      @Restrict("#{identity.loggedIn}")
      public class CurrentUser {
      
          @In
          private JpaIdentityStore identityStore;
      
          @In
          private Identity identity;
      
          @Unwrap
          public MyAppUser getMyAppUser() {
              String userLogin = identity.getPrincipal().getName();
              return (MyAppUser) identityStore.lookupUser(userLogin);
          }
      
          public static final MyAppUser instance() {
              return (MyAppUser) Component.getInstance(CurrentUser.class);
          }
      
      }
      



      Everything work fine with this component except that


      WARN  [Component] Component class should be serializable: currentUser


      is displayed when JBoss starts.


      Can anyone explain this warning meaning?