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

[BUG] Fix GraalVM issue with Application Insights for Spring native #39699

Closed
jeanbisutti opened this issue Apr 14, 2024 · 1 comment · Fixed by #40151
Closed

[BUG] Fix GraalVM issue with Application Insights for Spring native #39699

jeanbisutti opened this issue Apr 14, 2024 · 1 comment · Fixed by #40151
Assignees

Comments

@jeanbisutti
Copy link
Contributor

Reproducer: https://github.com/Azure-Samples/java-native-telemetry

Version:

<dependency>
    <groupId>com.azure.spring</groupId>
    <artifactId>spring-cloud-azure-starter-monitor</artifactId>
    <version>1.0.0-beta.5</version>
</dependency>

--initialize-at-build-time=com.azure.core.util.logging.ClientLogger has to be added for GraalVM native compilation

@jeanbisutti
Copy link
Contributor Author

The error with class initialization message:

com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building:
 com.azure.core.util.logging.ClientLogger was unintentionally initialized at build time. com.azure.core.util.Configuration caused initialization of this class with the following trace:
        at com.azure.core.util.logging.ClientLogger.<clinit>(ClientLogger.java:61)
        at com.azure.core.util.Configuration.<clinit>(Configuration.java:258)

com.azure.core.util.Configuration is initialized at build time:

ClientLogger is then initialized by this static field:

private static final ClientLogger LOGGER = new ClientLogger(Configuration.class);

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

Successfully merging a pull request may close this issue.

1 participant