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

micrometer-cloudwatch feature fails to build as native image #55

Closed
JamieCressey opened this issue Dec 30, 2019 · 3 comments
Closed

micrometer-cloudwatch feature fails to build as native image #55

JamieCressey opened this issue Dec 30, 2019 · 3 comments
Assignees
Labels
info: workaround available A workaround is available for the issue relates-to: graal status: awaiting third-party Awaiting changes to a third party library type: bug Something isn't working

Comments

@JamieCressey
Copy link

Problem

The AWS v2 SDK is failing to build into a native image, and is being included (or the CloudWatch subsection is) as part of the micrometer-cloudwatch feature.

Error: Classes that should be initialized at run time got initialized during image building:
 io.netty.util.AbstractReferenceCounted the class was requested to be initialized at build time (from the command line). To see why io.netty.util.AbstractReferenceCounted got initialized use -H:+TraceClassInitialization

Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1

Steps to Reproduce

  • mn create-app test --features aws-api-gateway-graal --features micrometer-cloudwatch
  • cd test
  • ./docker-build.sh
mn --version
| Micronaut Version: 1.2.8
| JVM Version: 11.0.5
@graemerocher graemerocher transferred this issue from micronaut-projects/micronaut-profiles Jan 7, 2020
@graemerocher graemerocher added the type: bug Something isn't working label May 20, 2020
@ilopmar ilopmar self-assigned this Aug 5, 2020
@project-bot project-bot bot moved this from To do to In progress in Micronaut Development Aug 5, 2020
@ilopmar
Copy link
Contributor

ilopmar commented Aug 5, 2020

If you create a new application (tested with Micronaut 2.0.1):

mn create-app foo --features=micrometer-cloudwatch,graalvm

And then add --report-unsupported-elements-at-runtime to native-image.properties it works. The usage of that flag is discouraged so I've opened and issue on graalvm issue tracker: oracle/graal#2736

@ilopmar ilopmar added status: awaiting third-party Awaiting changes to a third party library info: workaround available A workaround is available for the issue labels Aug 5, 2020
@ilopmar ilopmar removed this from In progress in Micronaut Development Aug 12, 2020
@charlie-harvey
Copy link

I bumped into this because I need aws-sdk-v2 explicitly. I am reading from and writhing to a bucket. Thanks for the workaround.

@alvarosanchez
Copy link
Member

This is working as of Micronaut 2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info: workaround available A workaround is available for the issue relates-to: graal status: awaiting third-party Awaiting changes to a third party library type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants