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
Flyway-specific DataSource cannot be created in a native image due to missing reflection hints #33692
Comments
Thanks for the report. We're missing some reflection hints that allow the Flyway-specific DataSource to be created. You can work around this by providing the necessary hints manually:
This registrar can be imported using
|
Thank you so much @wilkinsona for the quick response, the app now works in native mode.
|
There are a couple of ways that we could fix this:
The second option is a more general solution. This would benefit |
https://github.com/wilkinsona/spring-boot/tree/gh-33692 contains an implementation of the second option. There are a couple of further considerations that I would like to discuss with the team:
|
Team discussion: 1) yes. 2) also yes |
The failures in this comment are interesting in the context of @Bean(name = "db1ServerDataSource")
@ConfigurationProperties("db1")
DataSource db1ServerDataSource() {
return DataSourceBuilder.create().build();
} Hikari's on the classpath so |
I wonder if adding hints might be a safer and less invasive option at this point? It's slightly annoying that the onus is on the caller to add the supplier. Hints might also allow the example above to work unchanged. Here's something I think might work https://github.com/philwebb/spring-boot/tree/gh-33692-2 |
We're going to go with the hints approach for now since it doesn't require any API changes. Longer term, we may well look into adding supplier support. |
Hi Team,
could anyone please look into this and let me know the workaround for the issue? or if there is a fix planned for this one.
Spring Boot Version: 3.0.1
Sample GitHub Repo:- https://github.com/mishraomp/spring-reactive
On JVM mode the app starts fine but in native mode it throws exception during startup. I have pasted the log outputs for the same.
JVM mode
Native Mode
The text was updated successfully, but these errors were encountered: