30

I am currently struggling with HTTP Session replication on tomcat with complex objects.

Some objects implement Serializable but hold non-serializable members.

Unfortunately, the stacktraces do not provide much useful info here by default.

there is a flag -XX:???? to enable verbose class names in the stacktrace when a NotSerializableException occurrs. this flag would help me a lot finding the source of the error. but i forgot its name

What is the name of the flag?

P̲̳x͓L̳
  • 3,615
  • 3
  • 29
  • 37
Andreas Petersson
  • 16,248
  • 11
  • 59
  • 91

1 Answers1

61

-Dsun.io.serialization.extendedDebugInfo=true

Andreas Petersson
  • 16,248
  • 11
  • 59
  • 91
  • I need to wait 2 days before i can mark this as accepted, due to SO rules. i found the answer at http://mfondo.blogspot.com/2007/10/java-serialization-debugging.html – Andreas Petersson Nov 02 '09 at 18:44
  • 2
    It's probably worth mentioning that this flag only kicks in when there is a serialization problem, as a result the logs won't go crazy before the event occurs. – mrswadge Oct 21 '14 at 08:37
  • @AndreasPetersson where to set this? like I am using tomcat server – eatSleepCode Feb 02 '15 at 12:24
  • @eatSleepCode The command line for starting Tomcat. It's a Java parameter, so it needs to be placed into the java command. – mrswadge Nov 30 '16 at 17:49