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

aws-crt-java causes an error when native compiled with graalvm #780

Closed
klopfdreh opened this issue Apr 23, 2024 · 5 comments
Closed

aws-crt-java causes an error when native compiled with graalvm #780

klopfdreh opened this issue Apr 23, 2024 · 5 comments
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue

Comments

@klopfdreh
Copy link

klopfdreh commented Apr 23, 2024

Describe the bug

Spring Boot Native build is not possible with aws-crt-java as there are many errors during the runtime.

Expected Behavior

Spring Boot Native build should run and use the JNI functionalities as it would run in a JVM.

Current Behavior

There are several issues during the runtime see solution.

Reproduction Steps

Perform a native-image build with GraalVM with Spring Boot 3.2.x.

Possible Solution

  1. Add a reflect-config.json and add the following content
[
  {
    "name": "software.amazon.awssdk.crt.s3.S3Client",
    "methods": [
      {
        "name": "<init>",
        "parameterTypes": []
      }
    ]
  }
]

This is required during the native build -H:ReflectionConfigurationResources=META-INF/.../reflect-config.json

  1. Add a resource-config.json and add the following content
{
  "resources": [
    {
      "pattern": "linux/x86_64/glibc/libaws-crt-jni.so"
    },
    ...
  ]
}

Note: ... means for each so-file.

This is require during the native build -H:ResourceConfigurationResources=META-INF/.../resource-config.json

  1. Provide the required JNI information with jni-config.json for the JNI resources so that it can be applied like described here: https://www.graalvm.org/latest/reference-manual/native-image/dynamic-features/JNI/ and here https://docs.oracle.com/en/graalvm/enterprise/20/docs/reference-manual/native-image/JNI/#integration - alternatively apply the code as a custom Feature

Additional Information/Context

I already tried to add the reflect-config.json and the resource-config.json into the classpath and run the image but failed with the following error inside the container: container.log

Is there any hint how to use AWS CRT with Spring Boot Native?

aws-crt-java version used

v0.29.18

Java version used

jdk17.0.10

Operating System and version

linux / ubi9-minimal:9.3-1612

@klopfdreh klopfdreh added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 23, 2024
@klopfdreh
Copy link
Author

See also: aws/aws-sdk-java-v2#5127

@jmklix jmklix added feature-request A feature should be added or improved. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. bug This issue is a bug. labels Apr 23, 2024
@jmklix
Copy link
Member

jmklix commented Apr 23, 2024

graalvm is currently not supported by the aws-crt-java. Changing this to a feature request

@klopfdreh
Copy link
Author

Hey thanks for catching up this issue - a PR is already made: #749 - I saw it after I created this issue. Related issue: #476

@klopfdreh
Copy link
Author

Resolved via: #791

@klopfdreh klopfdreh closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2024
@klopfdreh klopfdreh reopened this Jun 12, 2024
@klopfdreh
Copy link
Author

klopfdreh commented Jun 12, 2024

Closed as completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants