Skip to content
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 error #979

Open
lost22git opened this issue Sep 22, 2023 · 6 comments
Open

native image error #979

lost22git opened this issue Sep 22, 2023 · 6 comments

Comments

@lost22git
Copy link

lost22git commented Sep 22, 2023

  • graalvm version:
openjdk 21 2023-09-19
OpenJDK Runtime Environment GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15)
OpenJDK 64-Bit Server VM GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15, mixed mode, sharing)
  • gradle version
gradle-8.4-rc-1
  • sql-jdbc version
org.xerial:sqlite-jdbc:3.43.0.0
  • build.gradle
graalvmNative {
  binaries {
    main {
       buildArgs.addAll([
"-Dorg.sqlite.lib.exportPath=${project.layout.buildDirectory.get()}"
       ])
    }
  }
}
  • error info when native compile
[1/8] Initializing...                                                                                    (0.0s @ 0.07GB)
Error: Feature org.sqlite.nativeimage.SqliteJdbcFeature class not found on the classpath. Ensure that the name is correct and that the class is on the classpath.
com.oracle.svm.core.util.UserError$UserException: Feature org.sqlite.nativeimage.SqliteJdbcFeature class not found on the classpath. Ensure that the name is correct and that the class is on the classpath.
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:73)
------------------------------------------------------------------------------------------------------------------------
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.registerFeatures(FeatureHandler.java:183)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:897)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:591)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:551)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:538)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:720)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:142)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:97)
                        0.2s (4.1% of total time) in 16 GCs | Peak RSS: 0.47GB | CPU load: 2.92
@kkriske
Copy link
Contributor

kkriske commented Sep 29, 2023

Could this be specific to gradle (you are using a pre-release version)? CI runs on GraalVM 21 without issues: #983
Gradle seems to maybe not pick up the META-INF/versions/9 files from the multi-release jar, where the SqliteJdbcFeature class is located.

@lost22git
Copy link
Author

Maybe I need to invite a gradle expert @melix to help take a look at this issue

@asm0dey
Copy link

asm0dey commented Jun 28, 2024

@kkriske I have the same issue in my application, without gradle.

My workflow is roughly the following:

> /usr/lib/jvm/java-21-graalvm/bin/java -agentlib:native-image-agent=config-output-dir=META-INF/native-image -jar build/libs/opdsko-all.jar
# some logs here, also performing a couple of curl requests to warm tha application up a bit
> /usr/lib/jvm/java-21-graalvm/bin/native-image -jar build/libs/opdsko-all.jar
========================================================================================================================
GraalVM Native Image: Generating 'opdsko-all' (executable)...
========================================================================================================================
[1/8] Initializing...
                                                                                    (0.0s @ 0.27GB)
Error: Feature org.sqlite.nativeimage.SqliteJdbcFeature class not found on the classpath. Ensure that the name is correct and that the class is on the classpath.
------------------------------------------------------------------------------------------------------------------------
                        0.6s (18.4% of total time) in 19 GCs | Peak RSS: 0.92GB | CPU load: 6.73
========================================================================================================================
Finished generating 'opdsko-all' in 2.8s.

Tried the same with official Liberica NIK, without success either

@asm0dey
Copy link

asm0dey commented Jun 28, 2024

It seems to me that even native-image does not pick up this META-INF/versions/9 , but I checked it's there in the jar. I can share the project if you're interested

@kkriske
Copy link
Contributor

kkriske commented Jun 30, 2024

I'll try to find some time to take a look, if you share the project.
I'm using this in native-image without issues, on jdk 21, through gluon substrate but I doubt that should make a difference.
I am using it through a classpath build, rather than a jar build though.

@asm0dey
Copy link

asm0dey commented Jun 30, 2024

I get the error on this project: https://github.com/asm0dey/opdsko
I tried both gradle plugin and native-image approaches, nothing works and, for what's worse, I don't know how to debug it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants