Getting java.io.NotSerializableException with a spring service when stopping tomcat

后端 未结 4 1277
遇见更好的自我
遇见更好的自我 2021-01-13 11:11

i am using spring 3 with JSF 2 and i replaced JSF managed beans with spring beans, by adding on top of bean:

@Component(\"mybean\")
@Scope(\"session\")
         


        
4条回答
  •  广开言路
    2021-01-13 11:32

    Well, finally i was able to make it work fine as follows:

    1- The Service:

    @Service
    @Scope("singleton")
    public class PersonService{
    
    }
    

    2- The Spring Managed Bean:

     @Component("person")
       @Scope("session")
       public class PersonBean implements Serializable{
    
       @Inject
       private PersonService personService;
    
       }
    

    waiting for your feedback.

提交回复
热议问题