Announcement Announcement Module
Collapse
No announcement yet.
NotSerializableException: java.lang.Thread Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NotSerializableException: java.lang.Thread

    I don't know if it's the right place to post this issue as I don't know if it's a spring security issue or a webFlow issue.

    I'm using Spring MVC 3.05 + Spring Security 3.1.0.M2 + Spring WebFlow 2.2.1.

    Spring Security is used to log into my account information (/compte/**).
    Swf is used to create an account.

    The spring security config is working fine, I can login and logout switching from http to https (no exception at all).
    The account creation flow is working fine as well (no exception).

    But, if first I login then logout and then decide to create a new account, I get the exception below. The account creation fails only if I login and logout before.
    I cannot figure out where it comes from and what should I do and even where I should start to investigate.

    Any help on this topic would be really appriciated.
    I would add config files if needed.

    4 janv. 2011 13:49:24 org.apache.catalina.core.StandardWrapperValve invoke
    GRAVE: "Servlet.service()" pour la servlet www a généré une exception
    java.io.NotSerializableException: java.lang.Thread
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1156)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.writeObject(ObjectOutpu tStream.java:326)
    at java.util.HashMap.writeObject(HashMap.java:1001)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeWriteObject(Object StreamClass.java:945)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1509)
    at java.io.ObjectOutputStream.defaultWriteObject(Obje ctOutputStream.java:416)
    at org.springframework.webflow.core.collection.LocalA ttributeMap.writeObject(LocalAttributeMap.java:327 )
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeWriteObject(Object StreamClass.java:945)
    at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1150)
    at java.io.ObjectOutputStream.writeObject(ObjectOutpu tStream.java:326)
    at org.springframework.webflow.engine.impl.FlowSessio nImpl.writeExternal(FlowSessionImpl.java:154)

  • #2
    NotSerializableException: java.lang.Thread

    Ok, I found where the issue was coming from. The webFlow was trying to serialize one of my Object which was performing an action within a Thread. I set the Thread as transient to get it solved.

    Comment

    Working...
    X