Skip to content

[Avro] BC-break in 2.11.3 #224

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

Closed
marcospassos opened this issue Oct 12, 2020 · 6 comments
Closed

[Avro] BC-break in 2.11.3 #224

marcospassos opened this issue Oct 12, 2020 · 6 comments
Labels

Comments

@marcospassos
Copy link
Contributor

We updated our codebase to 2.11.3 and started getting the following error everywhere:

com.fasterxml.jackson.databind.JsonMappingException: class java.util.LinkedHashMap cannot be cast to class com.croct.platform.domain.user.UserAddress (java.util.LinkedHashMap is in module java.base of loader ‘bootstrap’; com.croct.platform.domain.user.UserAddress is in unnamed module of loader ‘app’)
 com.croct.platform.domain.serialization.user.UserProfileMixin$Builder[“address”])
	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281)
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:623)
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeSetAndReturn(MethodProperty.java:173)
	at com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer.vanillaDeserialize(BuilderBasedDeserializer.java:274)
	at com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer.deserialize(BuilderBasedDeserializer.java:198)
	at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:2079)
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1518)

For some reason, some classes cannot get deserialized (we're using mixins with builders).

Any idea what was introduced in 2.11.3 that can be causing these errors?

@cowtowncoder
Copy link
Member

Sigh. No idea what specifically would be, although guessing that from databind fixes, either issue 2821 or 2846 might be relevant.
Low level exception itself suggests loss of type information somewhere, type resolution failing.

I doubt this is Avro-specific, wondering if this:

FasterXML/jackson-databind#2876

might be due to same root cause, whatever it is.

@cowtowncoder
Copy link
Member

Actually, more like this one:

FasterXML/jackson-databind#2876

which is fixed and will be included in 2.11.4 (not yet out).

@marcospassos
Copy link
Contributor Author

Just for clarity, is this a hypothesis, or have you checked if this issue goes away with this fix?

@cowtowncoder
Copy link
Member

@marcospassos Without reproduction of the problem it is just a hypothesis, but symptoms and fix in question seem quite plausible. So if you have an easy way to verify it would be good to find out either way -- I hope to release 2.11.4 soon, before going on for my christmas break.

@cowtowncoder
Copy link
Member

Fwtw, 2.11.4 was released 12-Dec-2020. Then again 2.12 is out, latest being 2.12.3 as well.

At this point, a unit test would be required to reproduce the problem if it still remains.

@marcospassos
Copy link
Contributor Author

Fixed in FasterXML/jackson-databind#3220

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

No branches or pull requests

2 participants