-
Notifications
You must be signed in to change notification settings - Fork 38.1k
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
MappingJackson2MessageConverter fails with null pointer in Native mode #30975
Comments
Yes that is correct. If Spring has no way to know about reflection being performed on a concrete type (we can detect that for controller method arguments for example), the application or library must contribute the AOT hints itself. I'm not sure I understand the full picture behind your PR but I guess it makes sense in this case. Also see https://docs.spring.io/spring-framework/reference/core/aot.html#aot.hints |
Thanks for quick answer, much appreciate it! To give more context I am one of the maintainers for Spring Cloud AWS and I have started to tackle the native hint support. Regarding PR I still have Spring Cloud AWS SQS hints on my branch not pushed, that is why it is probably confusing, only have pushed config and core. I opened issue because Spring Cloud AWS SQS is developed on top of the Spring Messaging, (Template calls converter in order to convert from Message Spring object to AWS SQS message object, MappingJackson2MessageConverter is used to convert payload to String representation). I have not went deep into Spring Messaging since @tomazfernandes wrote our integration. Could you please provide me where to look for Will open discussion is Spring Kafka, since they are using similar way of converting to see how they handled it, to not spam here. Thanks again! |
I see, thanks. As for "automatic detection", Spring projects that define an annotation-backed programming model (like In your case, the metadata you're contributing seems static, mostly listing well-known types for the library. In this case, maybe contributing the GraalVM config files (like |
Spring MVC's (update: @bclozel and I posted at the same time. So see his comments as well) |
Big Thanks for links and explanation it helped!
I think this is exactly what we need since we have some custom annotation for SNS HTTP endpoint that work with I don't want to bug anymore with this, thanks again on all the tips will check links more thoroughly and work something out. |
Hello,
Possible enhancement?
When using MappingJackson2MessageConverter to convert payload to Message type I have noticed that in native mode MappingJackson2MessageConverter is failing when calling:
public final Message<?> toMessage(Object payload, @Nullable MessageHeaders headers) {
Only way to fix this is to provide reflection hints for class which is sent in method as
Object payload
.Is this normal behaviour?
Related to awspring/spring-cloud-aws#856 providing Native hints for Spring Cloud AWS SQS integration.
I can provide example if needed.
Edit: Since it uses reflection under the hood it kinda makes sense that given class needs to be enabled for reflection?
The text was updated successfully, but these errors were encountered: