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

Build native image failed samples/springboot3/pet-store-native #1061

Closed
VSVDEv opened this issue Sep 27, 2024 · 1 comment
Closed

Build native image failed samples/springboot3/pet-store-native #1061

VSVDEv opened this issue Sep 27, 2024 · 1 comment

Comments

@VSVDEv
Copy link

VSVDEv commented Sep 27, 2024

samples/springboot3/pet-store-native

Serverless Java Container version: eg. 1.5

Implementations: Spring Boot 3

Framework version: eg SpringBoot 3.3.4

Frontend service: REST API / HTTP API / ALB

Deployment method: eg SAM

Scenario

Try to build native image

Expected behavior

Build success

Actual behavior

Build failed

Steps to reproduce

*git clone https://github.com/aws/serverless-java-container.git

cd samples/springboot3/pet-store-native

docker build -t al2023-graalvm21:native-web .

docker run -it -v pwd:pwd -w pwd -v ~/.m2:/root/.m2 al2023-graalvm21:native-web ./mvnw clean -Pnative package -DskipTests

FOR Windows powershell I use

docker run -it -v "${pwd}:/project" -v "$env:USERPROFILE.m2:/root/.m2" -w /project al2023-graalvm21:native-web mvn clean -Pnative package -DskipTests

docker run -it -v "${pwd}:/project" -w /project al2023-graalvm21:native-web mvn clean -Pnative package -DskipTests

Full log output

Paste the full log output from the Lambda function's CloudWatch logs

logs
[INFO] --- native:0.10.3:build (default) @ pet-store-native ---
[WARNING] 'native:build' goal is deprecated. Use 'native:compile-no-fork' instead.
[INFO] Found GraalVM installation from JAVA_HOME variable.
[INFO] [graalvm reachability metadata repository for ch.qos.logback:logback-classic:1.5.8]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for ch.qos.logback:logback-classic:1.5.8]: Configuration directory is ch.qos.logback/logback-classic/1.4.9
[INFO] [graalvm reachability metadata repository for jakarta.servlet:jakarta.servlet-api:6.0.0]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for jakarta.servlet:jakarta.servlet-api:6.0.0]: Configuration directory is jakarta.servlet/jakarta.servlet-api/5.0.0
[INFO] [graalvm reachability metadata repository for com.fasterxml.jackson.core:jackson-databind:2.17.2]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for com.fasterxml.jackson.core:jackson-databind:2.17.2]: Configuration directory is com.fasterxml.jackson.core/jackson-databind/2.15.2
[INFO] Executing: /usr/lib/graalvm/bin/native-image -cp /project/target/classes:/root/.m2/repository/org/springframework/boot/spring-boot-starter/3.3.4/spring-boot-starter-3.3.4.jar:/root/.m2/repository/org/springframework/boot/spring-boot/3.3.4/spring-boot-3.3.4.jar:/root/.m2/repository/org/springframework/spring-context/6.1.13/spring-context-6.1.13.jar:/root/.m2/repository/org/springframework/spring-aop/6.1.13/spring-aop-6.1.13.jar:/root/.m2/repository/org/springframework/spring-beans/6.1.13/spring-beans-6.1.13.jar:/root/.m2/repository/org/springframework/spring-expression/6.1.13/spring-expression-6.1.13.jar:/root/.m2/repository/io/micrometer/micrometer-observation/1.13.4/micrometer-observation-1.13.4.jar:/root/.m2/repository/io/micrometer/micrometer-commons/1.13.4/micrometer-commons-1.13.4.jar:/root/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.3.4/spring-boot-autoconfigure-3.3.4.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter-logging/3.3.4/spring-boot-starter-logging-3.3.4.jar:/root/.m2/repository/ch/qos/logback/logback-classic/1.5.8/logback-classic-1.5.8.jar:/root/.m2/repository/ch/qos/logback/logback-core/1.5.8/logback-core-1.5.8.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.23.1/log4j-to-slf4j-2.23.1.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-api/2.23.1/log4j-api-2.23.1.jar:/root/.m2/repository/org/slf4j/jul-to-slf4j/2.0.16/jul-to-slf4j-2.0.16.jar:/root/.m2/repository/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar:/root/.m2/repository/org/springframework/spring-core/6.1.13/spring-core-6.1.13.jar:/root/.m2/repository/org/springframework/spring-jcl/6.1.13/spring-jcl-6.1.13.jar:/root/.m2/repository/org/yaml/snakeyaml/2.2/snakeyaml-2.2.jar:/root/.m2/repository/com/amazonaws/serverless/aws-serverless-java-container-springboot3/2.0.3/aws-serverless-java-container-springboot3-2.0.3.jar:/root/.m2/repository/org/springframework/cloud/spring-cloud-function-serverless-web/4.1.2/spring-cloud-function-serverless-web-4.1.2.jar:/root/.m2/repository/org/springframework/spring-webmvc/6.1.13/spring-webmvc-6.1.13.jar:/root/.m2/repository/org/springframework/spring-web/6.1.13/spring-web-6.1.13.jar:/root/.m2/repository/com/amazonaws/serverless/aws-serverless-java-container-core/2.0.3/aws-serverless-java-container-core-2.0.3.jar:/root/.m2/repository/jakarta/servlet/jakarta.servlet-api/6.0.0/jakarta.servlet-api-6.0.0.jar:/root/.m2/repository/jakarta/ws/rs/jakarta.ws.rs-api/3.1.0/jakarta.ws.rs-api-3.1.0.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.17.2/jackson-databind-2.17.2.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.17.2/jackson-annotations-2.17.2.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.17.2/jackson-core-2.17.2.jar:/root/.m2/repository/com/fasterxml/jackson/module/jackson-module-afterburner/2.17.2/jackson-module-afterburner-2.17.2.jar:/root/.m2/repository/org/apache/commons/commons-fileupload2-jakarta-servlet6/2.0.0-M2/commons-fileupload2-jakarta-servlet6-2.0.0-M2.jar:/root/.m2/repository/org/apache/commons/commons-fileupload2-core/2.0.0-M2/commons-fileupload2-core-2.0.0-M2.jar:/root/.m2/repository/commons-io/commons-io/2.15.1/commons-io-2.15.1.jar:/root/.m2/repository/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar:/root/.m2/repository/com/amazonaws/aws-lambda-java-events/3.13.0/aws-lambda-java-events-3.13.0.jar:/root/.m2/repository/joda-time/joda-time/2.10.8/joda-time-2.10.8.jar --no-fallback -o /project/target/pet-store-native -H:ConfigurationFileDirectories=/project/target/graalvm-reachability-metadata/7c9867602b6e1b9359c63cd09f3d5aa598084c52/com.fasterxml.jackson.core/jackson-databind/2.15.2,/project/target/graalvm-reachability-metadata/7c9867602b6e1b9359c63cd09f3d5aa598084c52/jakarta.servlet/jakarta.servlet-api/5.0.0,/project/target/graalvm-reachability-metadata/7c9867602b6e1b9359c63cd09f3d5aa598084c52/ch.qos.logback/logback-classic/1.4.9 --enable-url-protocols=http --enable-preview -march=compatibility
Error: Unrecognized option(s): '--enable-preview -march=compatibility'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:05 min
[INFO] Finished at: 2024-09-27T09:24:36Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.10.3:build (default) on project pet-store-native: Execution of /usr/lib/graalvm/bin/native-image -cp /project/target/classes:/root/.m2/repository/org/springframework/boot/spring-boot-starter/3.3.4/spring-boot-starter-3.3.4.jar:/root/.m2/repository/org/springframework/boot/spring-boot/3.3.4/spring-boot-3.3.4.jar:/root/.m2/repository/org/springframework/spring-context/6.1.13/spring-context-6.1.13.jar:/root/.m2/repository/org/springframework/spring-aop/6.1.13/spring-aop-6.1.13.jar:/root/.m2/repository/org/springframework/spring-beans/6.1.13/spring-beans-6.1.13.jar:/root/.m2/repository/org/springframework/spring-expression/6.1.13/spring-expression-6.1.13.jar:/root/.m2/repository/io/micrometer/micrometer-observation/1.13.4/micrometer-observation-1.13.4.jar:/root/.m2/repository/io/micrometer/micrometer-commons/1.13.4/micrometer-commons-1.13.4.jar:/root/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.3.4/spring-boot-autoconfigure-3.3.4.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter-logging/3.3.4/spring-boot-starter-logging-3.3.4.jar:/root/.m2/repository/ch/qos/logback/logback-classic/1.5.8/logback-classic-1.5.8.jar:/root/.m2/repository/ch/qos/logback/logback-core/1.5.8/logback-core-1.5.8.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.23.1/log4j-to-slf4j-2.23.1.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-api/2.23.1/log4j-api-2.23.1.jar:/root/.m2/repository/org/slf4j/jul-to-slf4j/2.0.16/jul-to-slf4j-2.0.16.jar:/root/.m2/repository/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar:/root/.m2/repository/org/springframework/spring-core/6.1.13/spring-core-6.1.13.jar:/root/.m2/repository/org/springframework/spring-jcl/6.1.13/spring-jcl-6.1.13.jar:/root/.m2/repository/org/yaml/snakeyaml/2.2/snakeyaml-2.2.jar:/root/.m2/repository/com/amazonaws/serverless/aws-serverless-java-container-springboot3/2.0.3/aws-serverless-java-container-springboot3-2.0.3.jar:/root/.m2/repository/org/springframework/cloud/spring-cloud-function-serverless-web/4.1.2/spring-cloud-function-serverless-web-4.1.2.jar:/root/.m2/repository/org/springframework/spring-webmvc/6.1.13/spring-webmvc-6.1.13.jar:/root/.m2/repository/org/springframework/spring-web/6.1.13/spring-web-6.1.13.jar:/root/.m2/repository/com/amazonaws/serverless/aws-serverless-java-container-core/2.0.3/aws-serverless-java-container-core-2.0.3.jar:/root/.m2/repository/jakarta/servlet/jakarta.servlet-api/6.0.0/jakarta.servlet-api-6.0.0.jar:/root/.m2/repository/jakarta/ws/rs/jakarta.ws.rs-api/3.1.0/jakarta.ws.rs-api-3.1.0.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.17.2/jackson-databind-2.17.2.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.17.2/jackson-annotations-2.17.2.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.17.2/jackson-core-2.17.2.jar:/root/.m2/repository/com/fasterxml/jackson/module/jackson-module-afterburner/2.17.2/jackson-module-afterburner-2.17.2.jar:/root/.m2/repository/org/apache/commons/commons-fileupload2-jakarta-servlet6/2.0.0-M2/commons-fileupload2-jakarta-servlet6-2.0.0-M2.jar:/root/.m2/repository/org/apache/commons/commons-fileupload2-core/2.0.0-M2/commons-fileupload2-core-2.0.0-M2.jar:/root/.m2/repository/commons-io/commons-io/2.15.1/commons-io-2.15.1.jar:/root/.m2/repository/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar:/root/.m2/repository/com/amazonaws/aws-lambda-java-events/3.13.0/aws-lambda-java-events-3.13.0.jar:/root/.m2/repository/joda-time/joda-time/2.10.8/joda-time-2.10.8.jar --no-fallback -o /project/target/pet-store-native -H:ConfigurationFileDirectories=/project/target/graalvm-reachability-metadata/7c9867602b6e1b9359c63cd09f3d5aa598084c52/com.fasterxml.jackson.core/jackson-databind/2.15.2,/project/target/graalvm-reachability-metadata/7c9867602b6e1b9359c63cd09f3d5aa598084c52/jakarta.servlet/jakarta.servlet-api/5.0.0,/project/target/graalvm-reachability-metadata/7c9867602b6e1b9359c63cd09f3d5aa598084c52/ch.qos.logback/logback-classic/1.4.9 --enable-url-protocols=http --enable-preview -march=compatibility returned non-zero result -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
@deki deki closed this as completed in 5d4a231 Sep 27, 2024
@deki
Copy link
Collaborator

deki commented Sep 27, 2024

Thanks for the bug report. I've removed the --enable-preview and it works again.

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

2 participants