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

Actuator is always needed to build a native image with spring-boot-testcontainers #38392

Closed
eddumelendez opened this issue Nov 19, 2023 · 2 comments
Labels
status: superseded An issue that has been superseded by another

Comments

@eddumelendez
Copy link
Contributor

eddumelendez commented Nov 19, 2023

Among all ContainerConnectionDetailsFactory, org.springframework.boot.testcontainers.service.connection.zipkin.ZipkinContainerConnectionDetailsFactory is one of the ConnectionDetails that is not in spring-boot-autoconfigure and it is registered here

Project: https://github.com/eddumelendez/testcontainers-samples/tree/main/spring-boot-jpa
GHA: https://github.com/eddumelendez/testcontainers-samples/actions/runs/6899103097/job/18770192551?pr=5
Log:

Exception in thread "main" org.springframework.test.context.aot.TestContextAotException: Failed to generate AOT artifacts for test classes [com.example.springbootjpa.ProfileRepositoryTest]
	at org.springframework.test.context.aot.TestContextAotGenerator.lambda$processAheadOfTime$5(TestContextAotGenerator.java:285)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
	at org.springframework.util.MultiValueMapAdapter.forEach(MultiValueMapAdapter.java:179)
	at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:243)
	at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:205)
	at org.springframework.test.context.aot.TestAotProcessor.performAotProcessing(TestAotProcessor.java:91)
	at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:72)
	at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:39)
	at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:82)
	at org.springframework.boot.test.context.SpringBootTestAotProcessor.main(SpringBootTestAotProcessor.java:63)
Caused by: org.springframework.test.context.aot.TestContextAotException: Failed to process test class [com.example.springbootjpa.ProfileRepositoryTest] for AOT
	at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:322)
	at org.springframework.test.context.aot.TestContextAotGenerator.lambda$processAheadOfTime$5(TestContextAotGenerator.java:276)
	... 9 more
Caused by: java.lang.IllegalArgumentException: Unable to instantiate factory class [org.springframework.boot.testcontainers.service.connection.zipkin.ZipkinContainerConnectionDetailsFactory] for factory type [org.springframework.aot.hint.RuntimeHintsRegistrar]
	at org.springframework.core.io.support.SpringFactoriesLoader$FailureHandler.lambda$throwing$0(SpringFactoriesLoader.java:647)
	at org.springframework.core.io.support.SpringFactoriesLoader$FailureHandler.lambda$handleMessage$3(SpringFactoriesLoader.java:671)
	at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:231)
	at org.springframework.core.io.support.SpringFactoriesLoader.load(SpringFactoriesLoader.java:206)
	at org.springframework.core.io.support.SpringFactoriesLoader.load(SpringFactoriesLoader.java:142)
	at org.springframework.beans.factory.aot.AotServices$Loader.load(AotServices.java:211)
	at org.springframework.context.aot.RuntimeHintsBeanFactoryInitializationAotProcessor.processAheadOfTime(RuntimeHintsBeanFactoryInitializationAotProcessor.java:60)
	at org.springframework.context.aot.BeanFactoryInitializationAotContributions.getContributions(BeanFactoryInitializationAotContributions.java:67)
	at org.springframework.context.aot.BeanFactoryInitializationAotContributions.<init>(BeanFactoryInitializationAotContributions.java:49)
	at org.springframework.context.aot.BeanFactoryInitializationAotContributions.<init>(BeanFactoryInitializationAotContributions.java:44)
	at org.springframework.context.aot.ApplicationContextAotGenerator.lambda$processAheadOfTime$0(ApplicationContextAotGenerator.java:58)
	at org.springframework.context.aot.ApplicationContextAotGenerator.withCglibClassHandler(ApplicationContextAotGenerator.java:67)
	at org.springframework.context.aot.ApplicationContextAotGenerator.processAheadOfTime(ApplicationContextAotGenerator.java:53)
	at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:318)
	... 10 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConnectionDetails
	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3549)
	at java.base/java.lang.Class.getConstructors(Class.java:2227)
	at org.springframework.core.io.support.SpringFactoriesLoader$FactoryInstantiator.findConstructor(SpringFactoriesLoader.java:405)
	at org.springframework.core.io.support.SpringFactoriesLoader$FactoryInstantiator.forClass(SpringFactoriesLoader.java:394)
	at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:227)
	... 21 more
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinConnectionDetails
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	... 27 more
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 19, 2023
@eddumelendez eddumelendez changed the title actuator is always needed to build a native image actuator is always needed to build a native image with spring-boot-testcontainers Nov 19, 2023
@wilkinsona
Copy link
Member

Thanks for catching this, @eddumelendez. I suspect that this was caused by the fix for #36606.

@wilkinsona wilkinsona added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 20, 2023
@wilkinsona wilkinsona added this to the 3.1.6 milestone Nov 20, 2023
@wilkinsona wilkinsona modified the milestones: 3.1.6, 3.2.0 Nov 20, 2023
@wilkinsona wilkinsona added type: regression A regression from a previous release for: team-meeting An issue we'd like to discuss as a team to make progress and removed type: task A general task labels Nov 20, 2023
@philwebb philwebb changed the title actuator is always needed to build a native image with spring-boot-testcontainers Actuator is always needed to build a native image with spring-boot-testcontainers Nov 20, 2023
@philwebb
Copy link
Member

Actually, since #36606 never made it to a release I'll close this one a superseded so it's not in the release notes.

@philwebb philwebb closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2023
@philwebb philwebb removed this from the 3.2.0 milestone Nov 21, 2023
@philwebb philwebb added status: superseded An issue that has been superseded by another and removed type: regression A regression from a previous release for: team-meeting An issue we'd like to discuss as a team to make progress labels Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

4 participants