-
Notifications
You must be signed in to change notification settings - Fork 293
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
Native Image Build Fails after upgrading dd-trace-java from 1.40.0 to 1.43.0 #8054
Comments
Hi @mimiyanwk - thanks for the additional details Do you see the same error messages when using quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21 ? |
Yes, I have seen the same error message. |
We have been having one error here that looks almost the same:
I've made a reproducer https://github.com/luneo7/kafka-with-quarkus , just clone it update |
Funny thing, is that it seems related to profiling, but profiling in our case is not enabled |
With the latest version we need to add |
@mcculls created this PR #8315 which adds the "missing" classes to be rerun... with that everything works correctly in our internal tests... dunno if you guys want to add that to be rerun, or will want to refactor, as with refactoring we can also prevent those threads to be created during build time... |
Hi @luneo7 - thanks for the contribution, looks like we'll need to do a bit of refactoring anyway as the change as-is causes an older native-image smoke test to fail. I'll attempt to fix that tomorrow. |
Thanks @luneo7 - I've applied your fix and it will be in the 1.47.0 release in a few weeks time |
I am attempting to build a native image for my quarkus application as described on the website https://docs.datadoghq.com/tracing/trace_collection/compatibility/java/?tab=quarkusnative, but I am encountering initialization issues related to classes during the build time. These issues have arisen after upgrading Datadog's Java APM agent from version 1.40.0 to 1.43.0.
When building the native image, I receive the following error messages:
The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=. Or you can write your own initialization methods and call them explicitly from your main entry point.
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected a started Thread in the image heap. Thread name: dd-task-scheduler. Threads running in the image generator are no longer running at image runtime. If these objects should not be stored in the image heap, you can use
to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with
to prevent the instantiation of the object.
The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=. Or you can write your own initialization methods and call them explicitly from your main entry point.
I build the quarkus native using:
Quarkus Version: 3.15
Builder Image: quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-23
Command:
Workaround
I must mark the classes explicitly for run time initialization with:
The text was updated successfully, but these errors were encountered: