Closed
Description
Stephane Mikaty opened SPR-12060 and commented
Overview
I'm still getting the error mentioned in the reference URL, and I have not found any other mention of this edge case. Is this by design or simply not implemented yet?
I attached the files I used as reproduction.
demo.notworking
exhibits the issuedemo.working
works as expected and so I think Spring core JMS pom.xml #1 could well be supported with a simple code fix.
When running demo.notworking.ConcreteSubTest
as JUnit Test, I get the following:
java.lang.IllegalStateException: Neither GenericXmlContextLoader nor AnnotationConfigContextLoader was able to load an ApplicationContext from [MergedContextConfiguration@7e02286 testClass = ConcreteSubTest, locations = '{classpath:/test-config.xml}', classes = '{class demo.notworking.ConcreteSubTest$Config}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]].
When running demo.working.ConcreteSubTest as JUnit Test, I get the following:
org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [demo.StringLabelBean] is defined: expected single matching bean but found 2: demo.StringLabelBean#0,bean
Deliverables
- Improve exception message in
AbstractDelegatingSmartContextLoader.loadContext()
to provide better clarity in scenarios like the one described above.
Affects: 3.2.6, 3.2.10, 4.0.6
Attachments:
- testfiles.tgz (1.17 kB)
Referenced from: commits 181299c