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
Failures caused by using buildpacks to create a native image without declaring the native build tools Maven plugin are hard to diagnose #33412
Comments
Thanks for the sample. I've reproduced the problem when building the app using
Making a request to
@ah1508 Assuming that you have a local GraalVM installation, what behaviour do you see if you build the app using |
Indeed, it works with |
This looks like that reachability metadata is missing in the image built by the buildpacks. |
Yeah, that's was it. Thanks, @mhalbritter. The reachability metadata is missing because there's no plugin declaration in the pom file for While we do document the need to declare both Boot's plugin and Graal's plugin, I think we should try to improve the diagnostics here. It's harder than it should be to figure out what's gone wrong when only Boot's plugin is declared. We could log a warning or perhaps even fail fast. |
indeed, it works with It was in the plugin documentation, but how about updating the requiremenents here: https://docs.spring.io/spring-boot/docs/3.0.0/reference/htmlsingle/#native-image.developing-your-first-application.buildpacks For the time being, This means you can just type a single command and quickly get a sensible image into your locally running Docker daemon is a bit misleading. The plugin could also be added in the pom.xml generated by start.spring.io. Like |
it is included when selecting the GraalVM feature in start.spring.io. Gradle:
Maven:
The section in the documentation assumes that you have created your project with start.spring.io:
|
I'm not sure that it does make that assumption. It says "you should ensure that your I think we should mention the need to declare the |
Following up on the last messages of this issue #32659 , I cannot use HikariCP with native image.
I tried to narrow the problem as much as possible so this example is a demo application created with start.spring.io, with only HikariCP and H2 as dependencies. Not even spring-jdbc so auto configuration will not apply, Datasource is created with a
@Bean
method.new HikariDataSource()
works, pool initialization does not (first call todatasource.getConnection()
does not).The project
Steps to reproduce the problem:
curl http://localhost:8080/hikari
leads towhich does not work. The stacktrace
curl http://localhost:8080/direct leads to:
which works.
Stacktrace also shows logback problems.
OS: ubuntu 22.10, docker: 20.10.21, Maven: 3.8.6, Java: 17.0.5
The text was updated successfully, but these errors were encountered: