Hide
When using Spring 2.5 the DwrNamespaceHandler can no longer find the class for beans that rely on a parent's bean definition to set the class to use.
Spring 2.5 does not create ChildBeanDefinition for such beans, but creates a GenericBeanDefinition (that also has a getParentName() method).
To work around this I changed the resolveBeanClassname method for the RemoteBeanDefinitionDecorator (see below). Basically I just use the top level method instead of checking what instance it is. This addressed the problem for me...
private String resolveBeanClassname(BeanDefinition definition, BeanDefinitionRegistry registry)
{
String beanClassName = definition.getBeanClassName();
if (!StringUtils.hasText(beanClassName))
{
String parentName = definition.getParentName();
while (parentName != null)
{
BeanDefinition parentDefinition = findParentDefinition(parentName, registry);
if (parentDefinition == null)
{
if (log.isDebugEnabled())
{
log.debug("No parent bean named '" + parentName + "' could be found in the " +
"hierarchy of BeanFactorys. Check you've defined a bean called '" + parentName + "'");
}
break;
}
beanClassName = parentDefinition.getBeanClassName();
if (StringUtils.hasText(beanClassName ))
{
// found the class name we were looking for
break;
}
parentName = parentDefinition.getParentName();
}
}
return beanClassName;
}
Show
When using Spring 2.5 the DwrNamespaceHandler can no longer find the class for beans that rely on a parent's bean definition to set the class to use.
Spring 2.5 does not create ChildBeanDefinition for such beans, but creates a GenericBeanDefinition (that also has a getParentName() method).
To work around this I changed the resolveBeanClassname method for the RemoteBeanDefinitionDecorator (see below). Basically I just use the top level method instead of checking what instance it is. This addressed the problem for me...
private String resolveBeanClassname(BeanDefinition definition, BeanDefinitionRegistry registry)
{
String beanClassName = definition.getBeanClassName();
if (!StringUtils.hasText(beanClassName))
{
String parentName = definition.getParentName();
while (parentName != null)
{
BeanDefinition parentDefinition = findParentDefinition(parentName, registry);
if (parentDefinition == null)
{
if (log.isDebugEnabled())
{
log.debug("No parent bean named '" + parentName + "' could be found in the " +
"hierarchy of BeanFactorys. Check you've defined a bean called '" + parentName + "'");
}
break;
}
beanClassName = parentDefinition.getBeanClassName();
if (StringUtils.hasText(beanClassName ))
{
// found the class name we were looking for
break;
}
parentName = parentDefinition.getParentName();
}
}
return beanClassName;
}