Feb 12th, 2010, 01:33 PM
I have a Spring Roo project and here is what's occuring:
1. I have a Service with Autowired dependencies
2. The Service is also annotated to be a Webservice by CXF
I have a breakpoint in the constructor of the service, as well as a setter method for one of the dependencies. During Spring init, the constructor is called twice, however the setter method is called once. I also wrote down the reference id for both instances.
When I call my webservice, I get back an instance where dependencies are null. I am not sure what's up.
The code is very basic, has anyone experiences something like this?
Feb 13th, 2010, 08:26 AM
There are 2 instances one managed by spring (correctly injected) and one managed by CXF not injected because spring doesn't know about it. I suggest you investigate a better integration for Spring and CXF.
Feb 13th, 2010, 10:23 AM
Just looked back at the cxf config, looks like I was missing this part:
Originally Posted by Marten Deinum
If you want to reference a spring managed-bean, you can write like this:
<bean id="hello" class="demo.spring.HelloWorldImpl" />
<jaxws:endpoint id="helloWorld" implementor="#hello" address="/HelloWorld" />
and only had this: