Hi, Spring experts and Forum Friends,
I've issue confused me , How many steps need to be made sure when change XML based applicationContext to Annotation-based applicationContext.
When I do this things , I've successfully changed applicationContext configuration of spring-ws, by overwrite the method
"protected WebApplicationContext createWebApplicationContext(ApplicationContext parent)".
In it, I just copy all of the statements of the method in super Class MessageDispatcherServlet, and add this
"" before was.refresh(), of course "Code:((AnnotationConfigWebApplicationContext)wac).register(MyOwnConfiguration.class);" is required in the constructor. It's really can do bean Injection after I did this. Then I read the "web-services-2.0.xsd" file to configur some ws required beans in MyOwConfiguration.class, it also worked. Then I'm sure I did successfully in spring-ws.Code:this.setContextClass(AnnotationConfigWebApplicationContext.class);
But while I did the same operation in apache-cxf , It's failed, in the same MyOwnConfiguration.class, in it, I found the
@Bean BeanType beanName(){} , although which can prepared beans, but after it was called, the @Resource public void setBean(BeanType bean) did not execute. And deeply, I found in AbstractBeanFactory, the statements below are executed in wrong case:
The gotten mbd is wrong , because it bring a Root[null] info. But the check statements could execute without any exception throwout.Code:final RootBeanDefinition mbd = getMergedLocalBeanDefinition(beanName); checkMergedBeanDefinition(mbd, beanName, args);
So Here I consult every friend , do you have any idea on config rootBeanDefinition for AnnotationConfigWebApplicationContext?


Reply With Quote
