Serialization exception - Websphere

This is a discussion on Serialization exception - Websphere ; Hi, Hi get this exception 23/04/08 13:34:09:053 CEST] 0000001f HttpSessDRSBu E storeObject: Caught Exception while trying to serialize. Stack trace: java.io.NotSerializableException: com.ibm.ws.webcontainer.srt.SRTServletRequest at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1085) at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1423) at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1395) at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1338) at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1083) at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1423) ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Serialization exception

  1. Serialization exception

    Hi,

    Hi get this exception


    23/04/08 13:34:09:053 CEST] 0000001f HttpSessDRSBu E storeObject: Caught
    Exception while trying to serialize. Stack trace:
    java.io.NotSerializableException: com.ibm.ws.webcontainer.srt.SRTServletRequest
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1085)
    at
    java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1423)
    at
    java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1395)
    at
    java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1338)
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1083)
    at
    java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1423)
    at
    java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1395)
    at
    java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1338)
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1083)
    at java.io.ObjectOutputStream.writeObject(ObjectOutpu tStream.java:309)
    at java.util.HashMap.writeObject(HashMap.java:1138)
    at sun.reflect.GeneratedMethodAccessor107.invoke(Unkn own Source)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:62)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at
    java.io.ObjectStreamClass.invokeWriteObject(Object StreamClass.java:971)
    at
    java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1387)
    at
    java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1338)
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1083)
    at
    java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1423)
    at
    java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1395)
    at
    java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1338)
    at
    java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1083)
    at java.io.ObjectOutputStream.writeObject(ObjectOutpu tStream.java:309)
    at
    com.ibm.ws.webcontainer.httpsession.HttpSessDRSBuf fWrapper.getBytes(HttpSessDRSBuffWrapper.java:258)
    at
    com.ibm.ws.webcontainer.httpsession.HttpSessDRSBuf fWrapper.storeObject(HttpSessDRSBuffWrapper.java:1 19)
    at
    com.ibm.ws.webcontainer.httpsession.DRSBackedHasht able.handlePropertyHits(DRSBackedHashtable.java:29 1)
    at
    com.ibm.ws.webcontainer.httpsession.DRSBackedHasht able.persistSession(DRSBackedHashtable.java:375)
    at
    com.ibm.ws.webcontainer.httpsession.BackedHashtabl e.ejbStore(BackedHashtable.java:2533)
    at
    com.ibm.ws.webcontainer.httpsession.BackedHashtabl e.storeSession(BackedHashtable.java:2166)
    at
    com.ibm.ws.webcontainer.httpsession.BackedHashtabl e.put(BackedHashtable.java:2815)
    at
    com.ibm.ws.webcontainer.httpsession.DatabaseSessio nContext.sync(DatabaseSessionContext.java:164)
    at
    com.ibm.ws.webcontainer.httpsession.SessionData.sy nc(SessionData.java:302)
    at
    com.ibm.ws.webcontainer.httpsession.DatabaseSessio nData.sync(DatabaseSessionData.java:967)
    at
    com.ibm.ws.webcontainer.httpsession.DatabaseSessio nContext.checkForSessionWrites(DatabaseSessionCont ext.java:652)
    at
    com.ibm.ws.webcontainer.httpsession.DatabaseSessio nContext.asyncExternalWrite(DatabaseSessionContext .java:490)
    at
    com.ibm.ws.webcontainer.httpsession.SessionAlarmLi stener.alarm(SessionAlarmListener.java:61)
    at com.ibm.ejs.util.am._Alarm.run(_Alarm.java:90)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1471)

    [23/04/08 13:34:09:053 CEST] 0000001f SessionContex E handlePropertyHits:
    Failed to replicate attribute
    myContactListForm:com.pwc.lu.web.corelate.form.con tact.MyContactListForm@20562056
    [23/04/08 13:51:5


    I MyContactListForm is an AcionForm, Ichecked all data and they are all serializable.

    How can I found the source of this error?

    Many thanks.

  2. Re: Serialization exception

    barreauamandine@yahoo.fr wrote:
    > Hi,
    >
    > Hi get this exception
    >
    >
    > 23/04/08 13:34:09:053 CEST] 0000001f HttpSessDRSBu E storeObject: Caught
    > Exception while trying to serialize. Stack trace:
    > java.io.NotSerializableException: com.ibm.ws.webcontainer.srt.SRTServletRequest
    > at
    > java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1085)
    > at
    > java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1423)
    > at
    > java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1395)
    > at
    > java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1338)
    > at
    > java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1083)
    > at
    > java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1423)
    > at
    > java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1395)
    > at
    > java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1338)
    > at
    > java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1083)
    > at java.io.ObjectOutputStream.writeObject(ObjectOutpu tStream.java:309)
    > at java.util.HashMap.writeObject(HashMap.java:1138)
    > at sun.reflect.GeneratedMethodAccessor107.invoke(Unkn own Source)
    > at
    > sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:62)
    > at java.lang.reflect.Method.invoke(Method.java:391)
    > at
    > java.io.ObjectStreamClass.invokeWriteObject(Object StreamClass.java:971)
    > at
    > java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1387)
    > at
    > java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1338)
    > at
    > java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1083)
    > at
    > java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1423)
    > at
    > java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1395)
    > at
    > java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1338)
    > at
    > java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1083)
    > at java.io.ObjectOutputStream.writeObject(ObjectOutpu tStream.java:309)
    > at
    > com.ibm.ws.webcontainer.httpsession.HttpSessDRSBuf fWrapper.getBytes(HttpSessDRSBuffWrapper.java:258)
    > at
    > com.ibm.ws.webcontainer.httpsession.HttpSessDRSBuf fWrapper.storeObject(HttpSessDRSBuffWrapper.java:1 19)
    > at
    > com.ibm.ws.webcontainer.httpsession.DRSBackedHasht able.handlePropertyHits(DRSBackedHashtable.java:29 1)
    > at
    > com.ibm.ws.webcontainer.httpsession.DRSBackedHasht able.persistSession(DRSBackedHashtable.java:375)
    > at
    > com.ibm.ws.webcontainer.httpsession.BackedHashtabl e.ejbStore(BackedHashtable.java:2533)
    > at
    > com.ibm.ws.webcontainer.httpsession.BackedHashtabl e.storeSession(BackedHashtable.java:2166)
    > at
    > com.ibm.ws.webcontainer.httpsession.BackedHashtabl e.put(BackedHashtable.java:2815)
    > at
    > com.ibm.ws.webcontainer.httpsession.DatabaseSessio nContext.sync(DatabaseSessionContext.java:164)
    > at
    > com.ibm.ws.webcontainer.httpsession.SessionData.sy nc(SessionData.java:302)
    > at
    > com.ibm.ws.webcontainer.httpsession.DatabaseSessio nData.sync(DatabaseSessionData.java:967)
    > at
    > com.ibm.ws.webcontainer.httpsession.DatabaseSessio nContext.checkForSessionWrites(DatabaseSessionCont ext.java:652)
    > at
    > com.ibm.ws.webcontainer.httpsession.DatabaseSessio nContext.asyncExternalWrite(DatabaseSessionContext .java:490)
    > at
    > com.ibm.ws.webcontainer.httpsession.SessionAlarmLi stener.alarm(SessionAlarmListener.java:61)
    > at com.ibm.ejs.util.am._Alarm.run(_Alarm.java:90)
    > at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1471)
    >
    > [23/04/08 13:34:09:053 CEST] 0000001f SessionContex E handlePropertyHits:
    > Failed to replicate attribute
    > myContactListForm:com.pwc.lu.web.corelate.form.con tact.MyContactListForm@20562056
    > [23/04/08 13:51:5
    >
    >
    > I MyContactListForm is an AcionForm, Ichecked all data and they are all serializable.
    >
    > How can I found the source of this error?
    >
    > Many thanks.
    >

    It appears that MyContactListForm contains the HttpServletRequest, which
    is not serializable.
    Ken

  3. Re: Serialization exception

    ARe you trying to store the request object in session?

  4. Re: Serialization exception

    Yes

  5. Re: Serialization exception

    You should never store the request object in session because the session lives past the lifecycle of the request.

+ Reply to Thread