Skip to content
Discussion options

You must be logged in to vote

Yes. What bit you is the default (lenient) reflection handling: calls like Class.getRecordComponents() or getDeclaredMethods() on an unregistered type don't fail, they just come back without the members, so Jackson finds no accessors and writes {}. Native Image has a stricter mode for exactly this case.

1. Build with --exact-reachability-metadata

native-image --exact-reachability-metadata ...

With this flag, missing metadata no longer degrades silently. The binary throws a MissingReflectionRegistrationError (a java.lang.Error) that names the exact element that was not registered. getRecordComponents(), getDeclaredMethods(), getDeclaredFields() and friends are all covered. See Reachability…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jameskomo
Comment options

Answer selected by jameskomo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants