It will take a bit of work to produce a standalone test for this, so I would like to describe it here first.
JC is in the process of creating a bean and goes recursive. Here's the synopsis:
- Way down the stack, "AbstractBeanFactory.getBean(String, Class)#line_168" is executing
- "CglibConfigurationEnhancer.BeanMethodInterceptor. doIntercept#line_306" is inside the "if(factoryContainsBean(beanName))" if-block
- "beanFactory.getBean(beanName)" is invoked, since JC sees that the bean creation is in progress
- Now we go to "DefaultJavaConfigBeanFactory extends AbstractBeanFactory.getBean(String)#line 164"
- which ultimately leads back to the first method listed above
Because of some poor legacy code that I'm trying to work thru, I have lots of code that does not inject beans, but rather pulls them from a BeanFactory. In this case, a ClassPathXmlApplicationContext is created (which contains the JC context that I have just recently added) but only the result of "ClassPathXmlApplicationContext.getBeanFactory ()" is saved from which the application extracts its beans. Since this is very non-typical, it could well be an edge case for JC.


