Missing hint issue when defining a custom MongoTemplate.#4763
Missing hint issue when defining a custom MongoTemplate.#4763omercelikceng wants to merge 1 commit intospring-projects:mainfrom
Conversation
|
Thank you for reaching out - this sounds very much like #4637 |
|
Hello @christophstrobl . Yes, I have seen this issue. It was resolved by removing the spring-cloud-starter-openfeign dependency. However, my problem is different and the related issue(#4637) has been closed. Therefore, I have created a new issue. Normally, when I create a native image and run the application, it works successfully. However, when I define MongoTemplate and TransactionTemplate beans as custom, create a native image, and run it, I get an error. This is because AggregationOperation is not registered in the hint. If you would like to reproduce the error, I have created a POC project(minimal sample). |
|
@omercelikceng thank you for the reproducer - the underlying issue remains the same as with #4637 being the This is not a scenario specific to Let me \\cc @sedleuze - maybe we could rethink 4637-comment#1953799740 regarding changes in core fw to cover this scenario. |
|
@christophstrobl Thank you very much for your interest. I thought that manually adding this class was the right approach. However, I understood what you meant. Actually, it was discussed that @snicoll would review this situation and provide feedback. However, it seems that the feedback was not provided, or I may have missed it. (#4637 (comment)). However, this issue hasn't been progressed. Also, the username 'sdeleuze' was incorrectly written, so I'm tagging again. @sdeleuze |
Hello,
I have a Spring Boot service where I save data to different databases at runtime. Additionally, I need to customize some settings based on certain conditions. Therefore, I create custom MongoTemplate beans. My implementation works successfully. So, under normal conditions, I can save my data to different databases and my code works.
However, when I build my project as a native image, it throws an error during startup. For now, I have solved the problem by adding the relevant class as a hint in my project. However, I wanted to contribute by opening a pull request for this issue.
To help you reproduce the issue, I am sharing a POC project. If you follow the steps in the README.md file on the main branch, you will encounter the error. Additionally, you can switch to the solution branch to see if the solution works.
Spring Boot Version : 3.3.2
The branch link where you can reproduce the error : https://github.com/omercelikceng/native-poc-mongodb-error/tree/main
The branch link where the error is resolved : https://github.com/omercelikceng/native-poc-mongodb-error/tree/solution
Error :