You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
When running the sample Sleuth application provided in #673 with the native image, we're getting the following:
java.lang.IllegalStateException: Error processing condition on org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60) ...
...
Caused by: java.lang.IllegalStateException: java.io.FileNotFoundException: class path resource [org/springframework/cloud/sleuth/autoconfig/otel/AnyTracerModePropertySetCondition$OnAutoTracerMode.class] cannot be opened because it does not exist
...
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/cloud/sleuth/autoconfig/otel/AnyTracerModePropertySetCondition$OnAutoTracerMode.class] cannot be opened because it does not exist
Tracing back to the source of the problem, we're seeing that an auto-configuration class is annotated with a custom condition:
And that condition itself points to the condition implementation:
@Conditional({AnyTracerModePropertySetCondition.class})
public @interface ConditionalOnOtelEnabled {
}
While we are providing a @NativeHint to register all classes in the @Conditional annotation, it seems that in this case the condition is relying on a package private static class, which is causing this issue:
I feel like I've seen this kind of pattern in another place too. Including @Conditional annotated nested classes within a type implementing NestedCondition doesn't seem totally unreasonable to catch these.
I had already done part of it (the support was there for recognizing NestedCondition types). I think I was playing around with it when working with actuator hints. So I finished that off. I updated the features sample app to include a scenario like above to verify correctness.
When running the sample Sleuth application provided in #673 with the native image, we're getting the following:
Tracing back to the source of the problem, we're seeing that an auto-configuration class is annotated with a custom condition:
And that condition itself points to the condition implementation:
While we are providing a
@NativeHint
to register all classes in the@Conditional
annotation, it seems that in this case the condition is relying on a package private static class, which is causing this issue:At this point, I'm not sure if we should consider this usage pattern as invalid or if we can improve the AOT processing to handle this case.
The text was updated successfully, but these errors were encountered: