-
Notifications
You must be signed in to change notification settings - Fork 40.7k
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
Native image doesn't start and doesn't log anything if an environment post processor throws an exception #40429
Comments
Thanks for getting in touch. Unfortunately there's not enough information here for us to understand exactly what you are doing. If you would like us to spend some time investigating, please provide a complete minimal sample that reproduces the problem. The reproducer should have the fewest dependencies possible, ideally without any Spring Cloud dependencies. You can share it with us by pushing it to a separate repository on GitHub or by zipping it and attaching it to this issue. |
Dear @scottfrederick, I managed to create a very small example reproducing the issue: Instructions about how to run it are in the README, please let me know if anything is missing. Thanks for the support |
Your environment post-processed relies on reflection through its use of SnakeYAML and you haven't provided any reachability metadata to convey that information to GraalVM. You can see the failure by wrapping the body of your
Running the native image will then show the failure:
You need to allow instances of Unfortunately, errors like this that occur before logging has been set up need to be handled carefully, particularly in a native image. We may be able to improve the diagnostics here, but I'm not certain that we can. |
My spring boot 3.2.4 project doesn't start up when built native if my technical library contains an EnvironmentPostProcessor linked in spring.factories resource. If I get rid of both from the library and just copy paste the same processor in the main project repo and build it again, it works fine.
The application doesn't start either locally nor from a kubernetes POD. It just exits at startup, no logs at all are printed out:
My POM looks like this:
While my-tech-starter has a bunch of spring boot / cloud dependencies but what really makes the diff looks to be this EnvironmentPostProcessor linked in the spring.factories:
If I removed those 2 files, it works. Even if I copy the SpringConfigImportEnvironmentPostProcessor in the main project. Note that the library is build with -Pnative flag and I can see the /META-INF/native-image/ inside the JAR.
If i do a standard, non native build, it works fine in any case.
Any idea? Thanks a lot
The text was updated successfully, but these errors were encountered: