-
Notifications
You must be signed in to change notification settings - Fork 1.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
GraalVM native binary throws java.lang.NoSuchMethodException #7630
Comments
Graal requires configuration to be able to use reflection, which jgit appears to do: https://docs.oracle.com/en/graalvm/enterprise/20/docs/reference-manual/native-image/Reflection/ – this is unfortunately not trivial, it's hard to say if it's feasible for jgit. Closing since this is a graal/jgit issue, nothing we can do about that (except add our own jgit integration) |
Thanks for getting back to me @yawkat. I understand that Graal needs configuration for reflection, and from this discussion on another issue, I got the impression that micronaut would be responsible for fully configuring the native image compilation, and that users shouldn't try to add their own configuration. What I don't follow from your message is this bit
What is jGit doing? |
No, micronaut does not (cannot) produce the reflection config for third-party libraries that we don't explicitly add support for. jgit is using reflection. |
Alright! Thanks. |
You can use |
You can also run the JAR with GraalVM and enable the tracing agent |
@alvarosanchez Would I then need to merge the configuration the tracer agent generates with the configuration that micronaut generates under |
What I would do is to isolate jgit in a standalone project with no Micronaut dependencies, and use the GraalVM agent in there. |
Alright, thanks! |
Expected Behavior
I've built an example cli application that uses a java git library form the eclipse project called jGit. While I can build and execute the application from a jar, I cannot build a native binary that executes correctly.
Actual Behaviour
The native binary does not execute as the jar does, and throws the following exception:
Steps To Reproduce
git clone https://github.com/miguelaferreira/issue-micronaut-graalvm-jgit.git
./gradlew nativeCompile
build/native/nativeCompile/cli-app-latest
Environment Information
Example Application
https://github.com/miguelaferreira/issue-micronaut-graalvm-jgit
Version
3.5.2
The text was updated successfully, but these errors were encountered: