Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.4.10
-
None
Description
The getBeanDefinition() in org.apache.wicket.spring.SpringBeanLocator and org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory will result in a Stack Overflow if a parent-context exists.
Offending code
private BeanDefinition getBeanDefinition(ConfigurableListableBeanFactory beanFactory, String name) { [....] BeanFactory parent = beanFactory.getParentBeanFactory(); if (parent != null && parent instanceof ConfigurableListableBeanFactory) { return getBeanDefinition(beanFactory, name); } [....] }
As you can see it always calls the getBeanDefinition() with the same arguments resulting in a stack overflow. That specific return statement should call the getBeanDefinition of the parent and therefore should be:
return getBeanDefinition((ConfigurableListableBeanFactory) parent, name);
I'll include a quick start to reproduce the error for the AnnotProxyFieldValueFactory and a patch to solve it for both.