-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Invalid JavaType for "org.eclipse.persistence.indirection.IndirectList" class #3361
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
Comments
First things first: 2.11.3 is not the latest patch for 2.11 so the issue should have been tested against 2.11.4. Description itself does not quite explain the problem so what I'd really need is a reproduction like unit test. But first it would be good to verify the issue exists in 2.13.1 or 2.12.6. |
Thanks for your quick respond. After some debugging I found out that issue happens from version 2.7.0. I am working on unit test with no 3rd party dependencies. This is challenging because we have internal logic when de serializing objects from JSON to Java so I hope to share it with you ASAP. Regards, |
After more investigation I think I found the root cause of this bug. It's probably relate to serializing and not to deserializing like I thought at the beginning.
For the given classes:
(class B serialized ONLY to text value) The difference is the class path that added per object in "myList" member which not happen in version 2.5.0. Regards, |
There is no way to try to configure the way Type Ids are written, except by annotations. Versions 2.5 and 2.6 are very very old by now, so I don't think anything in Jackson will help you handle the difference unfortunately. Changes in such cases should only have occurred if the older version (2.5.x) had a bug in serialization code, and that was fixed in later version (2.6.x). Otherwise structure should not have changed. Given this, I am not sure I can give much more help: if it was possible to have a test case where a new (2.12.6 f.ex) version wrote something that cannot be read with that version, we'd have a bug to work on. |
Ok, thanks for your help! Regards, |
No, there should not be a requirement for versions to match; different minor versions should match. But unfortunately in your case there seems to have been a change where this did not work. As a general guidance I do think it is good idea to try to keep similar versions of Jackson across all your systems, migrating over time. But that should not be required for data / structure compatibility. Another thing to consider is that some level of integration testing would allow verification of compatibility of new Jackson versions with your existing use cases: if issues are uncovered early enough (f.ex when new Jackson Release Candidates are released) they can be addressed to avoid compatibility issues. |
Describe the bug
I need to upgrade Jackson package from version 2.5.0 to 2.11.3.
When deserialize JSON field from type "org.eclipse.persistence.indirection.IndirectList", the function constructSpecializedType in TypeFactory class returns invalid JavaType than in my current version (2.5.0).
Version information
Which Jackson version(s) was this for?
2.11.3
Expected behavior
Return same JavaType object like in version 2.5.0.
The elements in IndirectList have custom deserializer and it's not being called at all. the logic in version 2.11.3 deserialize the elements as String object.
Additional context
See _elementType diff.
Should be simple type of CPUUID (which is my internal class) and not Object.
Version 2.5.0


Version 2.11.3
Thanks in advance,
Roy
The text was updated successfully, but these errors were encountered: