Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializing java.lang.Thread fails on JDK 11 and above (should suppress serialization of ClassLoader) #3130

Closed
cowtowncoder opened this issue Apr 24, 2021 · 1 comment
Labels
JDK11 Features that need JDK11 (and/or support JDK11)
Milestone

Comments

@cowtowncoder
Copy link
Member

Looks like serialization of Thread (for exp, Thread.currentThread()) fails with StackOverflow on JDK11, due to addition of a new property. Looks like this might be via ClassLoader, which probably should not really be serialized anyway.
Passed on JDK 8.

@cowtowncoder cowtowncoder added to-evaluate Issue that has been received but not yet evaluated 2.12 JDK11 Features that need JDK11 (and/or support JDK11) and removed to-evaluate Issue that has been received but not yet evaluated labels Apr 24, 2021
@cowtowncoder cowtowncoder changed the title Serializing java.lang.Thread fails on JDK 11 and above Serializing java.lang.Thread fails on JDK 11 and above (should suppress serialization of ClassLoader) Apr 24, 2021
@cowtowncoder cowtowncoder added 2.13 and removed 2.12 labels Apr 24, 2021
@cowtowncoder
Copy link
Member Author

Since this does change output, will not try to resolve in 2.12, will target 2.13.

Work-around for anyone hit by this would be to add ClassLoader type into "ignored types" list, like so:

    mapper.configOverride(ClassLoader.class).setIsIgnoredType(true);

which I think should work. If not, mix-in with @JsonIgnoredType against ClassLoader definitely should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JDK11 Features that need JDK11 (and/or support JDK11)
Projects
None yet
Development

No branches or pull requests

1 participant