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

[GR-60766] [Native Image] Pico CLI native app fails to run on Graal 23 #10390

Open
2 tasks done
Hakky54 opened this issue Dec 30, 2024 · 1 comment
Open
2 tasks done
Assignees

Comments

@Hakky54
Copy link

Hakky54 commented Dec 30, 2024

Describe the Issue

I am using Pico CLI alongside with Graal to create a native image for Certificate Ripper. I noticed that the Pico CLI app is working on Graal 22 but not on Graal 23 anymore when creating/running a native image.

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

openjdk 23.0.1 2024-10-15
OpenJDK Runtime Environment GraalVM CE 23.0.1+11.1 (build 23.0.1+11-jvmci-b01)
OpenJDK 64-Bit Server VM GraalVM CE 23.0.1+11.1 (build 23.0.1+11-jvmci-b01, mixed mode, sharing)

Operating System and Version

Mac OS X 14.5

Troubleshooting Confirmation

Run Command

./target/crip

Expected Behavior

No runtime exception

Actual Behavior

Exception in thread "main" picocli.CommandLine$InitializationException: Cannot instantiate nl.altindag.crip.command.VersionProvider: the class has no constructor
        at picocli.CommandLine$DefaultFactory.create(CommandLine.java:5689)
        at picocli.CommandLine$DefaultFactory.createVersionProvider(CommandLine.java:5675)
        at picocli.CommandLine$Model$CommandSpec.updateVersionProvider(CommandLine.java:7494)
        at picocli.CommandLine$Model$CommandSpec.updateCommandAttributes(CommandLine.java:7459)
        at picocli.CommandLine$Model$CommandReflection.extractCommandSpec(CommandLine.java:11845)
        at picocli.CommandLine$Model$CommandSpec.forAnnotatedObject(CommandLine.java:6392)
        at picocli.CommandLine.<init>(CommandLine.java:230)
        at picocli.CommandLine.<init>(CommandLine.java:224)
        at picocli.CommandLine.<init>(CommandLine.java:199)
        at nl.altindag.crip.App.main(App.java:25)
        at java.base@23.0.1/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: java.lang.NoSuchMethodException: nl.altindag.crip.command.VersionProvider.<init>()
        at java.base@23.0.1/java.lang.Class.checkConstructor(DynamicHub.java:1171)
        at java.base@23.0.1/java.lang.Class.getConstructor0(DynamicHub.java:1365)
        at java.base@23.0.1/java.lang.Class.getDeclaredConstructor(DynamicHub.java:3004)
        at picocli.CommandLine$DefaultFactory.create(CommandLine.java:5660)
        at picocli.CommandLine$DefaultFactory.create(CommandLine.java:5687)
        ... 10 more

Steps to Reproduce

  1. Install Graal 22 and 23 from https://www.graalvm.org/downloads/
  2. Make sure your java home is configured to point to version Graal 22
  3. Install maven
  4. run git clone https://github.com/Hakky54/certificate-ripper.git
  5. run mvn clean install -Pnative-image
  6. run ./target/crip (it does not give a runtime exception)
  7. configure java home to graal 23
  8. repeat step 5 and 6 and the runtime exception will be shown

Additional Context

No response

Run-Time Log Output and Error Messages

No response

@selhagani
Copy link
Member

Hi @Hakky54,

Thank you for reaching out to us about this. We will take a closer look into it and keep you updated.

@selhagani selhagani assigned loicottet and unassigned selhagani Jan 20, 2025
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

3 participants