-
-
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
Jackson in native image failed to deserialize JsonNode into ConcurrentHashMap with generics #4400
Comments
Wrong repo, will move to |
It sounds like this might be same as #4299 ? If so, will be addressed in 2.17.0 release. |
I'm not sure but the exceptions are similar. In my code I'm using plain Java |
Maybe you can try with 2.17.0-rc1 that was just released to see if the issue is resolved?
…On Tue, Feb 27, 2024 at 4:56 PM zipper ***@***.***> wrote:
It sounds like this might be same as #4299
<#4299> ? If so, will
be addressed in 2.17.0 release.
I'm not sure but the exceptions are similar. In my code I'm using plain
Java accounts = (new ObjectMapper()).convertValue(v, new
TypeReference<ConcurrentHashMap<Integer, Account>>() {}); and the
exception clearly points to ObjectMapper._convert. In #4299
<#4299> reproducer(
https://github.com/edudar/feign-native), client.getData() should
reference the code public record Data(String id, String name, Set<String>
sets, List<String> lists, Map<String, String> maps) {} in Data.java; but
I don't know the exact method triggering the exception is the same.
—
Reply to this email directly, view it on GitHub
<#4400 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAANOGNZKQI2LC5CZHE5LI3YVZ6CXAVCNFSM6AAAAABD2ZXVSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRXHE4TAMRTGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@cowtowncoder - I tried 2.17.0-rc1 and it worked, the issue is resolved. Thank you and the team! |
@zipper01 Thank you for verifying! |
The deserializer is claimed as
@JsonDeserialize(using = Subscriber.Deserializer.class)
and defined as below, which works perfectly in a jar file running withJava -jar
:But after I converted the jar file to a native image using GraalVM's
native-image
tool and run the native image, it threw the below exception (at lineconvertValue
) at run-time:I tried to use
MapType type = jsonObjectMapper.getTypeFactory().constructMapType(ConcurrentHashMap.class, Integer.class, Account.class)
instead ofTypeReference
and it resulted in the same.The
jackson.core version
is 2.16.1 and:native-image --version
native-image 21.0.2 2024-01-16
GraalVM Runtime Environment Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30)
Substrate VM Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS, serial gc, compressed references)
I posted this to StackOverflow and got no correct answer and I realized it may need to change the Jackson Jason lib.
The text was updated successfully, but these errors were encountered: