-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
XmlAdapter result marshaling error in case of ValueType=Object #731
Comments
Sounds like a bug. There are some issues with handling XmlAdapter, but I hope this one is something easier to handle. |
@cowtowncoder It's not an issue with XmlAdapter only, I wrote a unit test for native Converter and get the same result. You can find my research and possible fix in #732 |
Ah. Only now fully understood the issue -- right, dynamic meaning that since type is not specified as anything more than |
@cowtowncoder Thanks a lot for your update! We are really waiting a fix for this issue, because our migrating on 2 major version has been stuck in it and we don't want to produce own forks/builds. |
No problem. This will be in 2.5.3; in the meantime perhaps you can try SNAPSHOT build locally? |
@cowtowncoder Sure, we will make SNAPSHOT build. By "we don't want to produce own forks/builds" I mean we don't want to create forks with our own fixes not included in main repo and that we will need to adopt for future versions. Make a temporary build is not an issue. Thanks! |
Hi,
I have an error "com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class java.lang.String and no properties discovered to create BeanSerializer" in case of using custom XmlAdapter with such declaration:
If change declaration of this class to "extends XmlAdapter<String, List>" it works good.
Full example:
In this state with last Jackson version we will get an error
But if we change XmlJavaTypeAdapter to IntegerListToStringXmlAdapter error will be fixed and code will work fine.
This error exists only in Jackson 2, we have this code with Object generic on Jackson 1 and get an issue only during migration to new major version.
This concrete error can be fixed by hack in com.fasterxml.jackson.databind.ser.std.StdDelegatingSerializer:
You can find test class here: https://github.com/Spikhalskiy/jackson_xmladapter__bug/blob/master/src/test/java/IntegerListXmlAdapterTest.java
and hacked serializer code here: https://github.com/Spikhalskiy/jackson_xmladapter__bug/blob/master/src/main/java/com/fasterxml/jackson/databind/ser/std/StdDelegatingSerializer.java
Now test passing in this repo because of fake StdDelegatingSerializer in classpath - try to delete it to get an issue.
The text was updated successfully, but these errors were encountered: