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

CachingParanamer breaks java.io.Serializable #266

Closed
cresny opened this issue Jun 21, 2016 · 3 comments
Closed

CachingParanamer breaks java.io.Serializable #266

cresny opened this issue Jun 21, 2016 · 3 comments

Comments

@cresny
Copy link

cresny commented Jun 21, 2016

using v 2.7.2, trying to serialize an ObjectReader instance (used in a Flink serialized function), I get this error:

com.fasterxml.jackson.module.paranamer.shaded.CachingParanamer
java.io.NotSerializableException: com.fasterxml.jackson.module.paranamer.shaded.CachingParanamer

I have verified that the ObjectReader instance does serialize correctly id the DefaultScalaModule is not registered. Is there a workaround for this?

@cowtowncoder
Copy link
Member

cowtowncoder commented Jun 21, 2016

Probably won't make much difference, but the latest is 2.7.4, so might make sense to try it just to make sure.

As to problem itself, this would be Paranamer class, just shaded, which we can not do much about, at least directly. It would be necessary to know call/dependency graph. It looks like paranamer module uses CachingParanamer, so fix should probably go in there. I'll file a bug for the project, to see if it can be isolated and hopefully fixed.

Generally however it is often better to try to avoid getting Jackson's object mapper, reader or writer from getting in transitive closure that is serialized. If at all possible. It's still quite a bit of stuff to transfer, without much value (as long as it can be re-created by workers).

@cresny
Copy link
Author

cresny commented Jun 22, 2016

Thanks, I caught this at the end of the day, too brain-dead to realize it's an easy workaround in scala using @transient lazy val. So there's no urgency at least for me.

@cowtowncoder
Copy link
Member

cowtowncoder commented Jun 24, 2016

For what that is worth, it is fixed for paranamer module for next releases, (2.7.6 / 2.8.0) since mapper/reader/writer ought to remain serializable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants