Announcement Announcement Module
No announcement yet.
JAX-WS autowiring doesn't work on WebLogic Server Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • JAX-WS autowiring doesn't work on WebLogic Server


    Recently I'm trying to add Spring's autowiring support to my JAX-WS web services by having them inherit from SpringBeanAutowiringSupport, i.e.

    public class Foo extends SpringBeanAutowiringSupport {

    private Bar bar;


    And also, define these services in web.xml:

    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>


    But however, at runtime I found the dependency injection never happened. After looking into Spring's code, I guess the problem might be that Spring probably requires that my WS servlet and ContextLoaderListener should be able to get access to exactly the same thread context class loader (i.e. the classloader for the webapp), but when weblogic processes my servlet, it temporarily sets the thread context class loader to a dedicated JAXWS class loader which inherits from the regular webapp class loader, and this causes that my servlet can't share the spring application context of the webapp, so that the DI gets ignored.

    If I'm not doing anything wrong, I just wonder if there's any solution on the spring side?

    Thanks a lot!

  • #2
    I am trying to do the same thing and it doesnt seem to work. Has anyone tried using the SpringBeanAutowiringSupport on endpoint and got the injection working? I have spent a lot of time on this and am going nowhere. I am using weblogic 10.3 onJava 6


    • #3

      I doesn't work for me either. I am using tc Server v6.0 with Spring 2.5.6.SEC01 and Apache CXF 2.2.4

      My web.xml is:
      The cxf-context.xml is:
      <import resource="classpath:META-INF/cxf/cxf.xml" />
      <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
      <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
      <context:annotation-config />
      <bean id="helloWorld" class="org.example.remoting.SimpleHelloWorld" />
      <jaxws:endpoint id="helloWorldService"
        implementor="org.example.remoting.jaxws.HelloWorldEndpoint" address="/helloWorldService" />
      My endpoint implementation is
      public class HelloWorldEndpoint extends SpringBeanAutowiringSupport implements RemoteHelloWorld{
      	private HelloWorld helloWorld;
      	public String getMessage() throws RemoteException {
      		return helloWorld.getMessage();
      In the logs I see:
      DEBUG: - Current WebApplicationContext is not available for processing of HelloWorldEndpoint: Make sure this class gets constructed in a Spring web application. Proceeding without injection.


      • #4
        There is a bug opened for that in JIRA: