0

I have a large bean graph that I'm trying to serialize. Getting serialization exception (a non-specific one). Anyone have a class that will help locate the issue?

  • See [Java flag to enable extended Serialization debugging info ](https://stackoverflow.com/questions/1660441/java-flag-to-enable-extended-serialization-debugging-info) – Vadzim Jun 04 '17 at 11:25

3 Answers3

14

From JDK6 you should be able to get extra information by setting the sun.io.serialization.extendedDebugInfo system property:

-Dsun.io.serialization.extendedDebugInfo=true
Tom Hawtin - tackline
  • 145,806
  • 30
  • 211
  • 305
  • where to set this flag in tomcat server? – eatSleepCode Feb 02 '15 at 12:25
  • @eatSleepCode It's probably worth creating a separate question about how set system properties/pass `-D` flags on Tomcat. I once would have been able to tell you. To not answer your question, it's always worth investing in [automated] testing, which would make such a problem disappear. – Tom Hawtin - tackline Feb 02 '15 at 14:01
0

Write one or more unit tests that serialize parts of the graph or the full graph. This will let you brak the problem into smaller pieces.

krosenvold
  • 75,535
  • 32
  • 152
  • 208
0

You could use a special output stream that will perform some additional checks. See this page as a reference.

Bogdan
  • 1,150
  • 3
  • 11
  • 17