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

io.micrometer.tracing.Tracer on the classpath breaks AOT processing for tests #33298

Closed
mhalbritter opened this issue Nov 22, 2022 · 0 comments
Closed
Assignees
Labels
theme: observability Issues related to observability type: bug A general bug
Milestone

Comments

@mhalbritter
Copy link
Contributor

mhalbritter commented Nov 22, 2022

Adding this dependency

implementation 'io.micrometer:micrometer-tracing-bridge-brave'

with SB 3.0.0-SNAPSHOT is enough to let the processTestAot task fail:

2022-11-22T13:25:01.952+01:00  WARN 56719 --- [           main] o.s.t.c.aot.TestContextAotGenerator      : Failed to generate AOT artifacts for test classes [com.example.demo.DemoApplicationTests]

org.springframework.test.context.aot.TestContextAotException: Failed to process test class [com.example.demo.DemoApplicationTests] for AOT
        at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:239) ~[spring-test-6.0.0.jar:6.0.0]
        at org.springframework.test.context.aot.TestContextAotGenerator.lambda$processAheadOfTime$4(TestContextAotGenerator.java:205) ~[spring-test-6.0.0.jar:6.0.0]
        at java.base/java.util.Map.forEach(Map.java:713) ~[na:na]
        at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:197) ~[spring-test-6.0.0.jar:6.0.0]
        at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:159) ~[spring-test-6.0.0.jar:6.0.0]
        at org.springframework.test.context.aot.TestAotProcessor.performAotProcessing(TestAotProcessor.java:91) ~[spring-test-6.0.0.jar:6.0.0]
        at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:72) ~[spring-test-6.0.0.jar:6.0.0]
        at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:39) ~[spring-test-6.0.0.jar:6.0.0]
        at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:82) ~[spring-context-6.0.0.jar:6.0.0]
        at org.springframework.boot.test.context.SpringBootTestAotProcessor.main(SpringBootTestAotProcessor.java:57) ~[spring-boot-test-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
Caused by: java.lang.IllegalStateException: No constructor or factory method candidate found for Root bean: class [io.micrometer.tracing.Tracer]; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null and argument types []
        at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorOrFactoryMethod(ConstructorResolver.java:939) ~[spring-beans-6.0.0.jar:6.0.0]
        at org.springframework.beans.factory.support.RegisteredBean.resolveConstructorOrFactoryMethod(RegisteredBean.java:197) ~[spring-beans-6.0.0.jar:6.0.0]
        at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.<init>(BeanDefinitionMethodGenerator.java:79) ~[spring-beans-6.0.0.jar:6.0.0]
        at org.springframework.beans.factory.aot.BeanDefinitionMethodGeneratorFactory.getBeanDefinitionMethodGenerator(BeanDefinitionMethodGeneratorFactory.java:102) ~[spring-beans-6.0.0.jar:6.0.0]
        at org.springframework.beans.factory.aot.BeanDefinitionMethodGeneratorFactory.getBeanDefinitionMethodGenerator(BeanDefinitionMethodGeneratorFactory.java:118) ~[spring-beans-6.0.0.jar:6.0.0]
        at org.springframework.beans.factory.aot.BeanRegistrationsAotProcessor.processAheadOfTime(BeanRegistrationsAotProcessor.java:45) ~[spring-beans-6.0.0.jar:6.0.0]
        at org.springframework.beans.factory.aot.BeanRegistrationsAotProcessor.processAheadOfTime(BeanRegistrationsAotProcessor.java:35) ~[spring-beans-6.0.0.jar:6.0.0]
        at org.springframework.context.aot.BeanFactoryInitializationAotContributions.getContributions(BeanFactoryInitializationAotContributions.java:67) ~[spring-context-6.0.0.jar:6.0.0]
        at org.springframework.context.aot.BeanFactoryInitializationAotContributions.<init>(BeanFactoryInitializationAotContributions.java:49) ~[spring-context-6.0.0.jar:6.0.0]
        at org.springframework.context.aot.BeanFactoryInitializationAotContributions.<init>(BeanFactoryInitializationAotContributions.java:44) ~[spring-context-6.0.0.jar:6.0.0]
        at org.springframework.context.aot.ApplicationContextAotGenerator.lambda$processAheadOfTime$0(ApplicationContextAotGenerator.java:58) ~[spring-context-6.0.0.jar:6.0.0]
        at org.springframework.context.aot.ApplicationContextAotGenerator.withCglibClassHandler(ApplicationContextAotGenerator.java:67) ~[spring-context-6.0.0.jar:6.0.0]
        at org.springframework.context.aot.ApplicationContextAotGenerator.processAheadOfTime(ApplicationContextAotGenerator.java:53) ~[spring-context-6.0.0.jar:6.0.0]
        at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:235) ~[spring-test-6.0.0.jar:6.0.0]
        ... 9 common frames omitted

I think this is related to #32907

Interestingly this doesn't let the build fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: observability Issues related to observability type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant