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

Cannot build native Image with guide "Creating your first Micronaut Graal Application" #1304

Open
heyimMarc opened this issue Jul 23, 2023 · 0 comments

Comments

@heyimMarc
Copy link

Hi there,

I was trying to compile my app native, which didn't work.
So after a lot of try and error I decided to use your guide "Creating your first Micronaut Graal Application" and start everything from scratch just to analyze the diff (I assumed this will compile). So I've used the codebase provided by the guide (Download) which runs in the same error message.

For any reason, the default config is not able to find the main class in the classpath. What do I miss? Is it an Apple Silicon issue?

Let me know if you need more Information. Would be awesome to get this running.

`11:34:33: Executing 'nativeCompile'...

Task :compileJava UP-TO-DATE
Task :processResources UP-TO-DATE
Task :classes UP-TO-DATE
Task :jar UP-TO-DATE
Task :generateResourcesConfigFile UP-TO-DATE

Task :nativeCompile FAILED
[native-image-plugin] GraalVM Toolchain detection is disabled
[native-image-plugin] GraalVM location read from environment variable: GRAALVM_HOME
[native-image-plugin] Native Image executable path: /Users/mnuetzel/.sdkman/candidates/java/22.3.r17-grl/lib/svm/bin/native-image
========================================================================================================================
�]8;;https://www.graalvm.org/native-image/�\GraalVM Native Image�]8;;�: Generating 'default' (�]8;;https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md#glossary-imagekind�\executable�]8;;�\)...
========================================================================================================================
[1/7] �]8;;https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md#stage-initializing�\Initializing�]8;;�\... (0,0s @ 0,13GB)
5 actionable tasks: 1 executed, 4 up-to-date
Error: Main entry point class 'example.micronaut.Application' neither found on the classpath nor on the modulepath.
classpath: '/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut.serde/micronaut-serde-jackson/2.0.1/b81b0337662cb612a89afa81aaea7bd642932828/micronaut-serde-jackson-2.0.1.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut.serde/micronaut-serde-support/2.0.1/377e65b9c99fbd5d5241bc32b46f9b651790a75e/micronaut-serde-support-2.0.1.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut.serde/micronaut-serde-api/2.0.1/b5f292b4a1a8d6c57072788b9bea939544a38523/micronaut-serde-api-2.0.1.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-jackson-core/4.0.0/3702449137d499574cff928ee2316a6e28ed21cb/micronaut-jackson-core-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-json-core/4.0.0/c04ce9a93b61d41245d6b1605489307eb40eebee/micronaut-json-core-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-server-netty/4.0.0/a74de39944fe3b86cb536bc63c6a0711f3ce4518/micronaut-http-server-netty-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-netty/4.0.0/a757bbc4ae2f57105c2727cc39e102e71bfe148a/micronaut-http-netty-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-server/4.0.0/ff78651486d7703faaed5db673a3291ae79cca40/micronaut-http-server-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-router/4.0.0/b859d5c9675f4603dac22a885dcca2c4151db487/micronaut-router-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http/4.0.0/a822ba75981241d62a81f63fcba3df16bd1bcd58/micronaut-http-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-context-propagation/4.0.0/254cc36566edaa7c4ce4c41f5170f2eff280cf33/micronaut-context-propagation-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-context/4.0.0/a47c740a3e90a879884e54f6048e2538be2d23f6/micronaut-context-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-aop/4.0.0/86f3e085326f010e4d3ce68210b36c5e9927f1df/micronaut-aop-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-buffer-netty/4.0.0/5cea23eda7448206dfc3bd5c7cb2cb302d25b724/micronaut-buffer-netty-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-inject/4.0.0/94a3e7f94e26637850781573f00605b1db99089e/micronaut-inject-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.4.8/f00ba91d993e4d14301b11968d3cacc3be7ef3e1/logback-classic-1.4.8.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.15.1/92a90d3739e970e03b5971839e4fe51f13c1fa3/jackson-annotations-2.15.1.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.15.1/241c054ba8503de092a12acad9f083dd39935cc0/jackson-core-2.15.1.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/jakarta.annotation/jakarta.annotation-api/2.1.1/48b9bda22b091b1f48b13af03fe36db3be6e1ae3/jakarta.annotation-api-2.1.1.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http2/4.1.94.Final/f651595784d6cca4cbca6a8ad74c48fceed6cea8/netty-codec-http2-4.1.94.Final.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http/4.1.94.Final/9e5404764092c1f6305ad5719078f46ab228d587/netty-codec-http-4.1.94.Final.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.netty/netty-handler/4.1.94.Final/cd9121ce24d6d3f2898946d04b0ef3ec548b00b4/netty-handler-4.1.94.Final.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec/4.1.94.Final/c70ef20ca338558147887df60f46341bc47f6900/netty-codec-4.1.94.Final.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport-native-unix-common/4.1.94.Final/3fa5f9d04b6b782d869d6e0657d896eeadca5866/netty-transport-native-unix-common-4.1.94.Final.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport/4.1.94.Final/ec783a737f96991a87b1d5794e2f9eb2024d708a/netty-transport-4.1.94.Final.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.netty/netty-buffer/4.1.94.Final/eec248b26f16e888688e5bb37b7eeda76b78d2f7/netty-buffer-4.1.94.Final.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.projectreactor/reactor-core/3.5.7/e6c6027d106da0140c266c72cd41b066a4b84802/reactor-core-3.5.7.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-core-reactive/4.0.0/e2520497e23a9d25c15a7bc28e25783dee0b23d3/micronaut-core-reactive-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/org.reactivestreams/reactive-streams/1.0.4/3864a1320d97d7b045f729a326e1e077661f31b7/reactive-streams-1.0.4.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-core/4.0.0/d3d1d5b080e45fb30bf8f53b1c503ac767e344ad/micronaut-core-4.0.0.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.4.8/3fba9c105e0efc5ffdcda701379687917d5286f7/logback-core-1.4.8.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/2.0.7/41eb7184ea9d556f23e18b5cb99cad1f8581fc00/slf4j-api-2.0.7.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.netty/netty-resolver/4.1.94.Final/e96f649e8e9dcb29a1f8e95328b99c9eb6cf76c2/netty-resolver-4.1.94.Final.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/io.netty/netty-common/4.1.94.Final/ad4ecf779ebc794cd351f57792f56ea01387b868/netty-common-4.1.94.Final.jar:/Users/mnuetzel/.gradle/caches/modules-2/files-2.1/jakarta.inject/jakarta.inject-api/2.0.1/4c28afe1991a941d7702fe1362c365f0a8641d1e/jakarta.inject-api-2.0.1.jar'
modulepath: '/Users/mnuetzel/.sdkman/candidates/java/22.3.r17-grl/lib/svm/library-support.jar'
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':nativeCompile'.

Process 'command '/Users/mnuetzel/.sdkman/candidates/java/22.3.r17-grl/bin/native-image'' finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 1s
11:34:35: Execution finished 'nativeCompile'.
`

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

No branches or pull requests

1 participant