On 13 July 2010 16:15, abhishek jain <abhishek.netj...@gmail.com> wrote:
> On Tue, Jul 13, 2010 at 2:11 PM, Peter Crowther < > peter.crowt...@melandra.com > > wrote: > > > On 13 July 2010 09:34, abhishek jain <abhishek.netj...@gmail.com> wrote: > > > > > I am using tomcat 5.5 , struts 1.x and i encounter the following error: > > > I actually store the object in session and retrieve that(for a shopping > > > cart > > > application), pl. advice what i can do to remove this error: > > > > > > java.io.NotSerializableException: com.cart.Customer > > > > > > > You need to make sure that com.cart.Customer (and anything else you store > > in > > the session) is serializable. > > > > - Peter > > > > Thanks Peter, > i will check but i get this error only at times, and not always. > Can this still be the cause of the problem. > thanks > abhishek > Yes. It's happening because your webapp is being reloaded (are you changing some part of it?) and there are active sessions. The sessions are serialised to persist them; then the webapp is restarted; then the sessions are deserialised. If there are no sessions at the time the webapp is restarted, the problem will not occur. - Peter