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 }}
Repository navigation
Regression in name-based dependency bean resolution with Groovy #36463
März 14, 2026 2:47:49 AM org.springframework.context.support.GenericApplicationContext refresh
WARNUNG: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'service1WithAlias' defined in org.spockframework.spring.mock.ComplexConfig: Unsatisfied dependency expressed through method 'service1WithAlias' parameter 0: No qualifying bean of type 'org.spockframework.spring.Service2' available: expected single matching bean but found 4: org.spockframework.spring.Service2#0,org.spockframework.spring.Service2#1,org.spockframework.spring.Service2#2,aName
When it tries to wire the aService2 dependency for the service1WithAlias bean, previosus versions resolved to the one bean that does not have a qualifier alias or name, i. e. the aService2 bean defined at the top.
Now with Spring 7 it finds all 4 of the Service2 beans defined at the top and complains that it does not know which one to use.
Actually, the same problem is with service1WithAnnotationName and service1WithAdditionalAlias.
Only if I comment out all three and their assertions, the test runs through.
So even selection by name does not work as before.
This looks like parameter names are not resolvable. Has that Groovy code effectively been compiled in a -parameters compatible way? Otherwise, this could be a consequence of #29559 where we removed debug symbol introspection in favor of -parameters. Note that we effectively removed debug symbol introspection in 6.1 already, so this should not be 7.0 specific.
Oh, yeah, also for Groovy you have to explicitly enable that metadata generation.
The Spring 6 tests seem to run against 6.0.0 so were not affected.
Sorry for the noise and thanks for the help.
Activity
Vampire commentedon Mar 14, 2026
Actually, the same problem is with
service1WithAnnotationNameandservice1WithAdditionalAlias.Only if I comment out all three and their assertions, the test runs through.
So even selection by name does not work as before.
jhoeller commentedon Mar 20, 2026
This looks like parameter names are not resolvable. Has that Groovy code effectively been compiled in a
-parameterscompatible way? Otherwise, this could be a consequence of #29559 where we removed debug symbol introspection in favor of-parameters. Note that we effectively removed debug symbol introspection in 6.1 already, so this should not be 7.0 specific.[-]Regression in dependency bean resolution[/-][+]Regression in name-based dependency bean resolution with Groovy[/+]Vampire commentedon Mar 21, 2026
Oh, yeah, also for Groovy you have to explicitly enable that metadata generation.
The Spring 6 tests seem to run against 6.0.0 so were not affected.
Sorry for the noise and thanks for the help.
jhoeller commentedon Mar 21, 2026
No worries! Good to hear that
-parameterssolves it for Groovy as well.