Announcement Announcement Module
Collapse
No announcement yet.
Null dependencies Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Null dependencies

    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?

    Thanks

  • #2
    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.

    Comment


    • #3
      Originally posted by Marten Deinum View Post
      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.
      Just looked back at the cxf config, looks like I was missing this part:

      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:

      <jaxws:endpoint
      id="helloWorld"
      implementor="demo.spring.HelloWorldImpl"
      address="/HelloWorld" />


      Thanks !

      Comment

      Working...
      X