Skip to content

8.0 (fix): Inject the beans generated ahead of time only once - #16709

Merged
jdaugherty merged 12 commits into
apache:8.0.xfrom
codeconsole:fix/generated-beans-injected-once-8.0.x
Oct 22, 2026
Merged

jdaugherty merged 12 commits into
apache:8.0.xfrom
codeconsole:fix/generated-beans-injected-once-8.0.x

Conversation

@codeconsole

@codeconsole codeconsole commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Backports the double-injection fix from #16180, which carries the same commits.

When an application runs on generated artifacts (-Dspring.aot.enabled=true), Grails registers Spring's @Autowired and common-annotation processors a second time. They are there for the annotated members the generated code cannot see: those of the beans plugins register as the application starts, and those of beans declared as an interface, like the link generator. But those processors also injected every bean the generated code had already injected, so a side-effecting @Autowired method ran twice. The AOT example application logs this on startup:

WARN ... MeterRegistry : This FunctionCounter has been already registered (MeterId{name='executor.completed', tags=[tag(name=grailsPromiseExecutor)]}), the registration will be ignored.

The code generated for each bean definition, inner beans included, now marks the definition as it returns it (GeneratedInjectionBeanRegistrationAotProcessor). The mark names the type whose members that code injects, and the definition's instance supplier records each instance it creates. With that:

  • An instance the generated code created is injected only through the members its class adds to that type. For a bean of exactly that type there are none. For one from a factory method declaring a superclass, those are the subclass's own members. The members the generated code injected, and their overrides in the bean's class (resolved through generic bridges), are first marked on the merged definition as configured from outside. Spring uses that mechanism to keep two processors from injecting one member.
  • Any other instance under that bean's name, such as one configureBean or the Hibernate bean container creates, is injected in full, as Spring injects any bean. A member annotated with both @Resource and @Autowired is left to the common processor, which comes first.
  • A definition declared any other way carries no mark and is processed as before. That holds whether it was registered before the generated code ran, after it, or in place of a generated one. A bean declared as an interface is also processed in full, since the generated code never saw its members.
  • @PostConstruct and @PreDestroy methods are called by the common processor for every instance. The names the generated code recorded for them are taken off its definitions when the processors are registered, so the container doesn't call them a second time. That includes under configureBean, which works on a copy of the definition.

The processors are also created through suppliers rather than reflectively. The AOT guide no longer lists them among the infrastructure an AOT-processed application lacks, and says what they are registered for.

GeneratedArtifactsInjectionSpec generates the code for each case, compiles it, starts a context from it, and counts every call.

Nothing changes for an application that does not run on generated artifacts.

An application running on generated artifacts has the annotation processors
registered again, for beans built by a supplier and declared as an interface.
Those processors also injected every bean the generated code had already
injected, so a side-effecting @Autowired method ran twice: every executor's
metrics were registered a second time on a JVM running with
-Dspring.aot.enabled=true.

The definitions the generated code contributed are now recorded as the
context is initialized, before any plugin declares a bean, and the processors
registered again leave them alone. They are also declared with suppliers, so
creating them needs no reflection.

(cherry picked from commit 8bfca2b)
The generated code injects a bean only through the annotated members of
the type its definition declares. A factory method declaring an interface,
as the link generator's does, leaves every annotated member of the class it
returns to the annotation processors Grails registers again. Skipping every
generated bean left the link generator without its URL mappings, so the AOT
example application failed to render a link.

The processors now leave a generated bean alone only when it is of exactly
the type its definition declares, or the subclass Spring generates for a
configuration class. A side-effecting @Autowired method on such a bean
still runs once.

(cherry picked from commit f2a1277)
They were written for 9.0 and are backported here.
@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.20513% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.1809%. Comparing base (75a355a) to head (20f2cb2).

Files with missing lines Patch % Lines
...ache/grails/core/aot/GeneratedBeanDefinitions.java 73.5849% 16 Missing and 12 partials ⚠️
...ArtifactsAutowiredAnnotationBeanPostProcessor.java 85.0000% 3 Missing ⚠️
...tedArtifactsCommonAnnotationBeanPostProcessor.java 80.0000% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #16709        +/-   ##
==================================================
+ Coverage     62.1568%   62.1809%   +0.0241%     
- Complexity      26860      26908        +48     
==================================================
  Files            2237       2241         +4     
  Lines          110588     110743       +155     
  Branches        20189      20215        +26     
==================================================
+ Hits            68738      68861       +123     
- Misses          32597      32617        +20     
- Partials         9253       9265        +12     
Files with missing lines Coverage Δ
.../boot/config/GrailsApplicationPostProcessor.groovy 76.6467% <100.0000%> (+0.4272%) ⬆️
...eneratedInjectionBeanRegistrationAotProcessor.java 100.0000% <100.0000%> (ø)
...ArtifactsAutowiredAnnotationBeanPostProcessor.java 85.0000% <85.0000%> (ø)
...tedArtifactsCommonAnnotationBeanPostProcessor.java 80.0000% <80.0000%> (ø)
...ache/grails/core/aot/GeneratedBeanDefinitions.java 73.5849% <73.5849%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jdaugherty jdaugherty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faithful backport of 8bfca2b and f2a1277 from #16180: only the @since lines differ, it merges cleanly on current 8.0.x, and CI is green.

I read the rule the processors apply against Spring 7.0.9. DefaultBeanRegistrationCodeFragments emits new RootBeanDefinition(userClass) and setTargetType(getUserClass(beanType)), and both AOT contributions (AutowiredAnnotationBeanPostProcessor, InitDestroyAnnotationBeanPostProcessor) key their work off RegisteredBean.getBeanClass(), the user class of that same type, so "the instance's user class is the declared type" is exactly the condition under which the generated code injected the bean and recorded its lifecycle methods. The CGLIB case in GeneratedBeanDefinitionsSpec matches what the generator emits: the user class, not the proxy. Boot 4.1.1 inserts the generated initializer at index 0 and sorts stably, so the unordered GrailsPluginLifecycleInitializer records after it and before any plugin bean.

Four non-blocking notes inline: the javadoc's claim about a bean of another class is exact only for an interface (a declared superclass is still injected twice through its own members; verified with a fixture), postProcessBeforeDestruction has no test, the initializer's "before any other" overstates Boot's ordering, and the AOT guide section still says these two processors are absent.

For the merge-up: #16180 carries the same two commits with @since 9.0. Once this reaches 9.0.x that branch needs them dropped, or its @since lines reconciled to 8.0.1.

GeneratedArtifactsCommonAnnotationBeanPostProcessor stands down in
postProcessBeforeDestruction for a bean the generated code created, so
the destruction method that code recorded on the definition runs once,
called by the container. Nothing exercised that.

The fixture now has a @PreDestroy method, which the generated definition
records as the generated code does, and a @resource setter, so the
common processor's injection is covered as well as the autowired one's.
Without the override the destruction method runs twice.
The generated code injects a bean through the annotated members of the
type its definition declares. For a factory method declaring a
superclass of the class it returns, the processors registered again for
generated artifacts then injected the whole class, so the superclass's
@Autowired and @resource members ran twice, and so did an @Autowired
override of one, which the generated code had already called.

Before processing such a bean, the processors now mark those members on
its definition as configured from outside, the mechanism Spring uses to
keep two processors from injecting one member, and inject only what the
subclass adds. Spring's own processor, as the code was generated with,
finds the members on the declared type, and the overrides in the bean's
class are marked with them. A factory method declaring an interface has
no members to mark, so its bean is processed fully, as before.

Lifecycle methods are unchanged: the processor calls them all and marks
them, so the container skips the ones the generated code recorded.
Spring Boot does not run the generated initializer before every other:
it adds it ahead of the application's initializers and sorts them
stably, so an initializer with an order runs before it. Recording is
correct as long as none of those registers a bean definition, which
holds for Spring Boot's own. Say that rather than the stronger claim.
The guide listed the autowired and common annotation processors among
the infrastructure an AOT-processed application no longer has. Grails
has registered them again since b1611e3, for the annotated members
the generated code cannot see: those of a bean a plugin registers at
runtime, and those of a bean declared as an interface and built by a
supplier. They now leave the members the generated code injected to
that code.
@codeconsole

codeconsole commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Where this stands at 1d6f73b, after jdaugherty's and James's reviews:

How a generated bean is recognized. The code generated for each definition, inner beans included, calls GeneratedBeanDefinitions.markGenerated(beanDefinition, "<type>") as it returns the definition. GeneratedInjectionBeanRegistrationAotProcessor writes that call. The mark names the type whose members the generated code injects, and the instance supplier records each instance it creates. Nothing is snapshotted at runtime, and GrailsPluginLifecycleInitializer is unchanged from 8.0.x.

Injection. For a bean whose merged definition carries the mark, the processors register that type's members as externally managed config members, along with their overrides resolved through generic bridges. Then they process the bean as Spring does. The instance the generated code created is injected only through what its class adds. Any other instance under that name, such as one from configureBean or the Hibernate bean container, is injected in full by a plain processor.

Lifecycle. The common processor calls annotated init and destroy methods for every instance. The names the generated code recorded for them are taken off its definitions when the processors are registered.

Tests. GeneratedArtifactsInjectionSpec generates the code for a context, compiles it with javac, starts a context from it with the processors registered, and counts every member call. It covers 11 cases:

  • an exact-type bean
  • a prototype
  • a bean declared as a superclass
  • a bean declared as a generic superclass
  • a bean declared as an interface
  • an inner bean
  • a bean declared before the generated code runs
  • a bean declared again after it
  • configureBean on another instance
  • configureBean on a never-created template
  • the Hibernate bean container's sequence

All 11 pass. Against the previous design, 5 fail: the inner bean, the early bean, and the three other-instance cases. Removing any one of the new pieces makes the cases it guards fail.

Verified. The grails-core suite and the style check pass on both branches. The AOT example application starts from regenerated code with 383 marked definitions and no warnings. On #16180, the native-i18n image builds with GraalVM 25 and passes every check.

Merge-up. #16180 carries the same commits as -x cherry-picks. The files this PR adds are identical there, and the files the two PRs share differ only by #16180's own changes. Merging 9.0.x into #16180 won't conflict on them.

@jamesfredley jamesfredley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approving. The ordinary top-level generated bean is no longer injected twice, and the guide is right that the two processors are registered again at runtime. The snapshot still treats the wrong beans as already generated, so some beans are injected zero times and some are still injected twice.

A subclass that overrides a generic superclass's annotated setter with
the actual type also gets a bridge taking the erased one. The generated
code calls the setter through that bridge, and ClassUtils resolves the
superclass method to the bridge too, so the bridge was marked. Spring's
autowiring metadata skips bridges and keeps the override, which was then
injected a second time.

BridgeMethodResolver resolves to the method the bridge leads to, which is
the member the processor holds.
The definitions the generated code contributed were taken from a
snapshot of the bean factory as the context was initialized, and a bean
was left alone when its definition was in the snapshot and its class was
the type the definition declared. That was wrong three ways:

- The snapshot held every definition registered by then, so a bean an
  initializer ordered ahead of the generated one declared was taken for
  a generated one, and nobody injected or initialized it.
- An inner bean is not in the registry, so it was never in the snapshot,
  and was injected twice.
- The decision went by name and type, not by instance. Another instance
  under a generated bean's name, as configureBean and the Hibernate bean
  container create, was left uninjected, and initializeBean skipped its
  @PostConstruct method.

The code generated for each definition, an inner bean's included, now
marks it as it returns it. GeneratedInjectionBeanRegistrationAotProcessor
has it call GeneratedBeanDefinitions.markGenerated, which names the type
whose members that code injects and has the instance supplier record,
by identity, each instance it creates. The processors read the mark from
the merged definition they are given and mark that type's members, and
their overrides, as configured from outside. They then process every
bean: an instance the generated code created only through what its class
adds, and any other instance in full, through a plain processor whose
metadata carries no marks.

Lifecycle methods are no longer skipped. The common processor calls the
annotated ones for every instance, as on a context without generated
code, and the names the generated code recorded for them are taken off
its definitions when the processors are registered. Left on, they made
configureBean call them twice, since it works on a copy of the definition
that keeps the recorded names but not what the processor called.

The snapshot, and recording it in GrailsPluginLifecycleInitializer, are
gone. GeneratedArtifactsInjectionSpec generates, compiles and runs the
code for each case and counts every call; the cases that the snapshot,
the name check and the inner bean got wrong fail without this change.

@jamesfredley jamesfredley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The four earlier comments are fixed. Generated code marks only the definitions it wrote, a fresh instance of a generated bean name is injected, nested beans are not injected twice, and the generic override is marked instead of the bridge. The targeted grails-core specs passed: 34 tests, 0 failures. Not approving yet because the fallback processors still inject a dual-annotated member independently.

Another instance of a generated bean, one handed to configureBean, is
injected in full by Spring's own processors, but each of the two did so
on its own. Spring runs the common processor first on a bean's
definition, and the autowired processor then leaves to it a member the
common one registered there. Without a shared definition, a field or
method annotated with both @resource(name = ...) and @Autowired was
injected twice, so autowiring replaced the named resource with the
primary bean, and a method annotated so ran twice.

The autowired processor now has Spring's common processor mark its
members on a definition for the instance first, and processes that
definition itself before injecting, as Spring would. The regression
configures such an instance and checks it against a bean declared any
other way: the named resource, and the method called once.

@jamesfredley jamesfredley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approving yet. The ordinary-instance case from the last comment is fixed: a field with both @Resource(name = "named") and @Autowired keeps the named resource, and a dual-annotated method runs once. The targeted AOT specs passed, 35 tests. A CGLIB-enhanced instance of that same bean still loses the exclusion.

The autowired processor prepared the definition for another instance
of a generated bean under the instance's user class, but the injection
that follows looks the metadata up under the instance's class. For a
CGLIB subclass handed to configureBean, the two differ, so the
metadata was rebuilt without the members the common processor had
taken, and a member annotated with both @resource(name = ...) and
@Autowired was injected twice again.

The definition is now prepared under the instance's class. The
regression configures a CGLIB-enhanced instance as well as a plain
one.
@testlens-app

testlens-app Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🚨 TestLens detected 62 failed tests 🚨

Failed Jobs without Test Failures

❌ CI / Hibernate7 Functional Tests (Java 25, indy=false)

Test Summary

Tip

Inspect all details with the TestLens CLI: testlens pr 16709

Groovy Snapshot Canary Build / Build Grails (shard 0) > :grails-test-examples-mongodb-hibernate5:test

Test Runs Flakiness
BookFongoSpec ❌ 1% 🟡

Groovy Snapshot Canary Build / Build Grails (shard 1) > :grails-data-mongodb-core:test (first 40 of 58)

Test Runs Flakiness
AttachMethodSpec ❌ 1% 🟡
BuiltinUniqueConstraintWorksWithTargetProxiesConstraintsSpec ❌ 1% 🟡
CircularOneToManySpec ❌ 1% 🟡
CommonTypesPersistenceSpec ❌ 1% 🟡
ConstraintsSpec ❌ 1% 🟡
CriteriaBuilderSpec ❌ 1% 🟡
CrossLayerMultiDataSourceSpec ❌ 1% 🟡
CrossLayerMultiTenantMultiDataSourceSpec ❌ 1% 🟡
CrudOperationsSpec ❌ 1% 🟡
DataServiceConnectionRoutingSpec ❌ 1% 🟡
DataServiceMultiTenantConnectionRoutingSpec ❌ 1% 🟡
DeleteAllSpec ❌ 1% 🟡
DetachedCriteriaSpec ❌ 1% 🟡
DirtyCheckEmbeddedCollectionSpec ❌ 1% 🟡
DirtyCheckingAfterListenerSpec ❌ 1% 🟡
DirtyCheckingSpec ❌ 1% 🟡
DisableAutotimeStampSpec ❌ 1% 🟡
DomainEventsSpec ❌ 1% 🟡
DomainMultiDataSourceSpec ❌ 1% 🟡
DomainMultiTenantMultiDataSourceSpec ❌ 1% 🟡
EnumSpec ❌ 1% 🟡
FindByExampleSpec ❌ 1% 🟡
FindByMethodSpec ❌ 1% 🟡
FindNativeSpec ❌ 1% 🟡
FindOrCreateWhereSpec ❌ 1% 🟡
FindOrSaveWhereSpec ❌ 1% 🟡
FindWhereSpec ❌ 1% 🟡
FirstAndLastMethodSpec ❌ 1% 🟡
GormEnhancerSpec ❌ 1% 🟡
GormValidateableSpec ❌ 1% 🟡
GroovyProxySpec ❌ 1% 🟡
InheritanceSpec ❌ 1% 🟡
ListOrderBySpec ❌ 1% 🟡
NegationSpec ❌ 1% 🟡
NestedTransactionSpec ❌ 1% 🟡
NotInListSpec ❌ 1% 🟡
NullValueEqualSpec ❌ 1% 🟡
OneToManySpec ❌ 1% 🟡
OneToOneSpec ❌ 1% 🟡
OptimisticLockingSpec ❌ 1% 🟡

Groovy Snapshot Canary Build / Build Grails (shard 2) > :grails-data-mongodb-spring-boot:test

Test Runs Flakiness
MongoDbGormAutoConfigurationDiscoverySpec ❌ 0% 🟢
MongoDbGormAutoConfigurationSpec ❌ 0% 🟢
MongoDbGormAutoConfigureWithGeoSpacialSpec ❌ 0% 🟢

🏷️ Commit: 20f2cb2
▶️ Tests: 99727 executed
⚪️ Checks: 94/94 completed

Test Failures (first 10 of 62)

BookFongoSpec (:grails-test-examples-mongodb-hibernate5:test in Groovy Snapshot Canary Build / Build Grails (shard 0))
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image mongo:8.0
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:346)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
	at functional.tests.EmbeddedMongoClient$Trait$Helper.createMongoClient(EmbeddedMongoClient.groovy:33)
	at grails.test.mongodb.MongoSpec.setupSpec(MongoSpec.groovy:117)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:551)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 4 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 1
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:520)
	... 6 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '(?i).*waiting for connections.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:904)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:487)
	... 6 more
AttachMethodSpec (:grails-data-mongodb-core:test in Groovy Snapshot Canary Build / Build Grails (shard 1))
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image mongo:8.0
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:346)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
	at org.apache.grails.data.mongo.core.GrailsDataMongoTckManager.setupSpec(GrailsDataMongoTckManager.groovy:80)
	at org.apache.grails.data.testing.tck.base.GrailsDataTckSpec.setupSpec(GrailsDataTckSpec.groovy:40)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:551)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 4 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 1
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:520)
	... 6 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '(?i).*waiting for connections.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:904)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:487)
	... 6 more
BuiltinUniqueConstraintWorksWithTargetProxiesConstraintsSpec (:grails-data-mongodb-core:test in Groovy Snapshot Canary Build / Build Grails (shard 1))
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image mongo:8.0
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:346)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
	at org.apache.grails.data.mongo.core.GrailsDataMongoTckManager.setupSpec(GrailsDataMongoTckManager.groovy:80)
	at org.apache.grails.data.testing.tck.base.GrailsDataTckSpec.setupSpec(GrailsDataTckSpec.groovy:40)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:551)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 4 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 1
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:520)
	... 6 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '(?i).*waiting for connections.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:904)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:487)
	... 6 more
CircularOneToManySpec (:grails-data-mongodb-core:test in Groovy Snapshot Canary Build / Build Grails (shard 1))
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image mongo:8.0
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:346)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
	at org.apache.grails.data.mongo.core.GrailsDataMongoTckManager.setupSpec(GrailsDataMongoTckManager.groovy:80)
	at org.apache.grails.data.testing.tck.base.GrailsDataTckSpec.setupSpec(GrailsDataTckSpec.groovy:40)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:551)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 4 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 1
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:520)
	... 6 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '(?i).*waiting for connections.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:904)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:487)
	... 6 more
CommonTypesPersistenceSpec (:grails-data-mongodb-core:test in Groovy Snapshot Canary Build / Build Grails (shard 1))
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image mongo:8.0
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:346)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
	at org.apache.grails.data.mongo.core.GrailsDataMongoTckManager.setupSpec(GrailsDataMongoTckManager.groovy:80)
	at org.apache.grails.data.testing.tck.base.GrailsDataTckSpec.setupSpec(GrailsDataTckSpec.groovy:40)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:551)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 4 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 1
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:520)
	... 6 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '(?i).*waiting for connections.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:904)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:487)
	... 6 more
ConstraintsSpec (:grails-data-mongodb-core:test in Groovy Snapshot Canary Build / Build Grails (shard 1))
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image mongo:8.0
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:346)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
	at org.apache.grails.data.mongo.core.GrailsDataMongoTckManager.setupSpec(GrailsDataMongoTckManager.groovy:80)
	at org.apache.grails.data.testing.tck.base.GrailsDataTckSpec.setupSpec(GrailsDataTckSpec.groovy:40)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:551)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 4 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 1
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:520)
	... 6 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '(?i).*waiting for connections.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:904)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:487)
	... 6 more
CriteriaBuilderSpec (:grails-data-mongodb-core:test in Groovy Snapshot Canary Build / Build Grails (shard 1))
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image mongo:8.0
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:346)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
	at org.apache.grails.data.mongo.core.GrailsDataMongoTckManager.setupSpec(GrailsDataMongoTckManager.groovy:80)
	at org.apache.grails.data.testing.tck.base.GrailsDataTckSpec.setupSpec(GrailsDataTckSpec.groovy:40)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:551)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 4 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 1
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:520)
	... 6 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '(?i).*waiting for connections.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:904)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:487)
	... 6 more
CrossLayerMultiDataSourceSpec (:grails-data-mongodb-core:test in Groovy Snapshot Canary Build / Build Grails (shard 1))
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image mongo:8.0
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:346)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
	at org.apache.grails.data.mongo.core.GrailsDataMongoTckManager.setupSpec(GrailsDataMongoTckManager.groovy:80)
	at org.apache.grails.data.testing.tck.base.GrailsDataTckSpec.setupSpec(GrailsDataTckSpec.groovy:40)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:551)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 4 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 1
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:520)
	... 6 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '(?i).*waiting for connections.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:904)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:487)
	... 6 more
CrossLayerMultiTenantMultiDataSourceSpec (:grails-data-mongodb-core:test in Groovy Snapshot Canary Build / Build Grails (shard 1))
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image mongo:8.0
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:346)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
	at org.apache.grails.data.mongo.core.GrailsDataMongoTckManager.setupSpec(GrailsDataMongoTckManager.groovy:80)
	at org.apache.grails.data.testing.tck.base.GrailsDataTckSpec.setupSpec(GrailsDataTckSpec.groovy:40)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:551)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 4 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 1
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:520)
	... 6 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '(?i).*waiting for connections.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:904)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:487)
	... 6 more
CrudOperationsSpec (:grails-data-mongodb-core:test in Groovy Snapshot Canary Build / Build Grails (shard 1))
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image mongo:8.0
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:346)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
	at org.apache.grails.data.mongo.core.GrailsDataMongoTckManager.setupSpec(GrailsDataMongoTckManager.groovy:80)
	at org.apache.grails.data.testing.tck.base.GrailsDataTckSpec.setupSpec(GrailsDataTckSpec.groovy:40)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:551)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:341)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 4 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 1
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:520)
	... 6 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '(?i).*waiting for connections.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:904)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:487)
	... 6 more

Rerun Controls (first 20 of 62)

Select tests to mute in this pull request:

  • AttachMethodSpec
  • BookFongoSpec
  • BuiltinUniqueConstraintWorksWithTargetProxiesConstraintsSpec
  • CircularOneToManySpec
  • CommonTypesPersistenceSpec
  • ConstraintsSpec
  • CriteriaBuilderSpec
  • CrossLayerMultiDataSourceSpec
  • CrossLayerMultiTenantMultiDataSourceSpec
  • CrudOperationsSpec
  • DataServiceConnectionRoutingSpec
  • DataServiceMultiTenantConnectionRoutingSpec
  • DeleteAllSpec
  • DetachedCriteriaSpec
  • DirtyCheckEmbeddedCollectionSpec
  • DirtyCheckingAfterListenerSpec
  • DirtyCheckingSpec
  • DisableAutotimeStampSpec
  • DomainEventsSpec
  • DomainMultiDataSourceSpec

Reuse successful test results:

  • ♻️ Only rerun the tests that failed or were muted before

Click the checkbox to trigger a rerun:

  • Rerun jobs

Learn more about TestLens at testlens.app/docs.

@jamesfredley jamesfredley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. The CGLIB comment is fixed. Fallback injection is prepared under bean.getClass(), so the metadata lookup matches and a dual-annotated member on a CGLIB-enhanced instance keeps the named resource and runs once. The focused AOT specs passed.

sbglasius
sbglasius approved these changes Oct 22, 2026 •
@jdaugherty
jdaugherty merged commit a348ef9 into apache:8.0.x Oct 22, 2026
93 of 97 checks passed
This was referenced Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants