satish surabhi opened SPR-14960 and commented
I want to report somewhat similar issue reported here: #15673 , now we are noticing autowire failing intermittently at least on the versions I have tried : 3.2.14 and 4.1.7.RELEASE. Following are the test classes with unit test. The test fails with NoSuchBeanDefinitionException for at least 2 (random) out of 5 attempts.
public interface BarInterface {}
public class Bar implements BarInterface {}
public class Foo {
@Autowired
public Bar bar;
}
@Configuration
public class FooBarConfiguration {
@Bean
public Foo foo() {
return new Foo();
}
@Bean
public BarInterface bar() {
return new Bar();
}
}
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {FooBarConfiguration.class}, loader=AnnotationConfigContextLoader.class)
public class TestSpringConfiguration {
@Test
public void testSpringConfiguration() {
System.out.println("config test");
}
}
Reference URL: #15673
Issue Links:
Referenced from: commits 845dbf0, 66aeeed
satish surabhi opened SPR-14960 and commented
I want to report somewhat similar issue reported here: #15673 , now we are noticing autowire failing intermittently at least on the versions I have tried : 3.2.14 and 4.1.7.RELEASE. Following are the test classes with unit test. The test fails with NoSuchBeanDefinitionException for at least 2 (random) out of 5 attempts.
Reference URL: #15673
Issue Links:
@Beanregistration order within Class-reflected configuration classesReferenced from: commits 845dbf0, 66aeeed