You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Maarten van Grootel (JIRA)" <ji...@apache.org> on 2010/09/06 16:00:33 UTC

[jira] Updated: (WICKET-3033) Stack Overflow in getBeanDefinition()'s of SpringBeanLocator and AnnotProxyFieldValueFactory

     [ https://issues.apache.org/jira/browse/WICKET-3033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maarten van Grootel updated WICKET-3033:
----------------------------------------

    Attachment: getBeanBug.tar.gz

This is the quickstart to reproduce the bug.

> Stack Overflow in getBeanDefinition()'s of SpringBeanLocator and AnnotProxyFieldValueFactory
> --------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3033
>                 URL: https://issues.apache.org/jira/browse/WICKET-3033
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-spring
>    Affects Versions: 1.4.10
>            Reporter: Maarten van Grootel
>         Attachments: getBeanBug.tar.gz
>
>
> 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
> {code}
> private BeanDefinition getBeanDefinition(ConfigurableListableBeanFactory beanFactory,
> 			String name)
> {
> 	[....]
> 	BeanFactory parent = beanFactory.getParentBeanFactory();
> 	if (parent != null && parent instanceof ConfigurableListableBeanFactory)
> 	{
> 		return getBeanDefinition(beanFactory, name);
> 	}
> 	[....]
> }
> {code}
> 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:
> {code}
> 	return getBeanDefinition((ConfigurableListableBeanFactory) parent, name);
> {code}
> I'll include a quick start to reproduce the error for the AnnotProxyFieldValueFactory and a patch to solve it for both.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.