-
Notifications
You must be signed in to change notification settings - Fork 560
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
Jackson afterburner module is not compatible with Java11 and GraalVM native image #428
Comments
Yeah, that is a known issue, see #369. https://github.com/FasterXML/jackson-modules-base/tree/master/blackbird looks like the way to go. Would you be willing to create a PR for that? |
Sure thing ! |
After some testings realizes that blackbird also not supporting native image generation with graal and it is throwing the exception below
To support native-image generation, need to get rid of this after burner module as in the, going forward jdk > 16 is not supporting the Unsafe.defineAnonymousClass https://bugs.openjdk.java.net/browse/JDK-8243287 |
Workaround ->
|
Is there any fix available for jackson for JAVA-11, serverless-container 1.6? I am getting the same issue. |
@siddharthjain210 have you read the previous comments? We are open for suggestions on how to fix it. For now the workaround above can be used. |
I am not able to understand where should i add this class. Should it be added in the application module. How would the imports from com.oracle.svm would be resolved. |
Please use it like below Add the following dependency to your project.
Create a class in your project with the above content. When you build your native image, it will load this substitution from the classpath. |
Thanks @mokmnovatti @deki. Able to resolve the issue with the temporary fix. Just needed to add a little change:
The GraalVm 21.3 throws an error on using className on @target. |
Is there a workaround for projects that doesn't use GraalVM? |
@joain946 as mentioned above we are open for suggestions. The critical part is in https://github.com/awslabs/aws-serverless-java-container/blob/3b5f1f021dc102678e2fb4da24c798b13b2457dd/aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/internal/LambdaContainerHandler.java#L88 so in case you want to create a pull request with a proposal on how to change it, we will definitely review it. |
The problem is that I don't have enough knowledge on what is going on here to be able to do a PR. First of all, is Afterburner needed at all? Because removing it would solve everything. Not sure if it was added for performance or functionality. Second would be to not use a static method for registering since that can't be overriden. But maybe that is causing issues for GraalVM instead? |
Well in my view it's not required but the performance is worse without it. So for 2.0 we should probably replace Afterburner with Blackbird and make it configurable so it can be disabled. |
Just found https://github.com/quarkusio/qson, maybe also worth trying, works well with GraalVM and Quarkus. |
@mokmnovatti I'm trying to create a native-springboot app with graal 21.1 and spring-native. your sample code was helpful in resolving some of the reflection issues. I'm facing this issue now:
Have you faced this issue? any help would be appreciated, thanks Another user has posted in stackoverflow about the same issue - https://stackoverflow.com/questions/72162962/native-image-spring-boot-aws-serverless-java-container-startup-error-mis |
Any plans, estimates or guesses when aws-serverless-java-container 2.0 might be available? |
We've added a sample for native https://github.com/aws/serverless-java-container/tree/main/samples/springboot3/pet-store-native which is working well. Removing the 2.0 milestone as this issue is no longer a blocker for GraalVM. |
Not sure i'm missing something or not but Jackson AfterBurner module is not compatible with java11 and throwing following error when it is compiled with graalvm-21.01 native image
https://github.com/awslabs/aws-serverless-java-container/blob/a72bad46a263d07d71fc2765be94899bfddbba11/aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/internal/LambdaContainerHandler.java#L88
but when the afterburner module is removed it is working fine !
might be good idea to migrate to https://github.com/stevenschlansker/jackson-blackbird which is promising with Java11
Find the code at https://github.com/mokmnovatti/my-service
The text was updated successfully, but these errors were encountered: