Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: JAX-WS class doesn't autowire my Bean

  1. #11
    Join Date
    Oct 2012
    Posts
    1

    Default

    Quote Originally Posted by lucasam View Post
    I found the solution to this issue

    You need to put Spring listener org.springframework.web.context.ContextLoaderListe ner before the Web Services listener com.sun.xml.ws.transport.http.servlet.WSServletCon textListener
    Even with this configuration I'm still having this problem. Any suggestions?

    GlassFish 3.1
    Spring 3.0.5.RELEASE

  2. #12
    Join Date
    Nov 2012
    Posts
    1

    Default

    On Websphere I believe this to be a problem with the websphere JAX-WS engine instantiating the Web service endpoints instead of getting them from the Spring container. You can see this by adding a breakpoint in the constructor, or even better in one of the setters for any spring wired bean in your Web Service IMPL class. You can see that Spring will initialize the beans and yet they will be null when accessed after a web service call. This leads me to believe that they are not the same bean.

    So in effect the bean properties are getting wired but the instance of the impl being used by WebSphere (or I would assume Glassfish) is not.

    One solution would be to make the impl ApplicationContextAware and use a static ApplicationContext. Then you can access any bean in the context using the GetBean methods made available via the static context.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •