You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to migrate to 3.0 RC2 I found that my cxf application would not start up. After digging around a bit I found that the default scope for all beans is no longer singleton scope (found in AbstractBeanDefinition) and this breaks a lot of core code in CXF. Is this an intentional change? If so what was the reasoning as it seems like it could have a lot of consequences on other frameworks which make use of the default scope for beans being singletons. Is there any workaround?
Affects: 3.0 RC2
The text was updated successfully, but these errors were encountered:
Specifically it breaks the BindingInfo registration which is done lazily using the SpringBeanMap and code which does:
// Take any bean name or alias that has a web service annotation
for (int i = 0; i < beanNames.length; i++) {
BeanDefinition def = ctxt.getBeanFactory().getBeanDefinition(beanNames[i]);
if (!def.isSingleton() || def.isAbstract()) {
continue;
}
// ... then goes and registers the bean as binding
unfortunately because the default scope is no longer singleton the if statement above fails.
Note that iterating over raw BeanDefinitions for metadata checking purposes is never a good idea because - by definition - it doesn't work with bean definition inheritance and bean definition post-processing at runtime, which may still override all sorts of metadata fields in the BeanDefinition. From that perspective, CXF and others should check merged bean definitions in those places instead (i.e. beanFactory.getMergedBeanDefinition instead of beanFactory.getBeanDefinition), or simply use beanFactory.isSingleton / beanFactory.getType / etc lookups and never touch bean definitions to begin with.
Matt Goldspink opened SPR-6391 and commented
While trying to migrate to 3.0 RC2 I found that my cxf application would not start up. After digging around a bit I found that the default scope for all beans is no longer singleton scope (found in AbstractBeanDefinition) and this breaks a lot of core code in CXF. Is this an intentional change? If so what was the reasoning as it seems like it could have a lot of consequences on other frameworks which make use of the default scope for beans being singletons. Is there any workaround?
Affects: 3.0 RC2
The text was updated successfully, but these errors were encountered: