Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-5652

JAX-WS intergation via SpringBeanAutowiringSupport doesn't work in Weblogic 10.3

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.6
    • Fix Version/s: 3.0.1
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Method for injecting dependencies in JAX-WS endpoint class, as described in the link below, doesn't work in Weblogic 10.3

      http://static.springframework.org/spring/docs/2.5.x/reference/remoting.html#remoting-web-services-jaxws-export-servlet

      It looks like Weblogic processes JAX-WS calls in separate classloader from web-app classloader. In the log files it's evident that Spring's context getting loaded twice: first on web-app startup (from org.springframework.web.context.ContextLoaderListener) and then upon handling of JAX-WS call. Following message from SpringBeanAutowiringSupport observed in log file as well:

      2009-04-06 10:05:45,701 DEBUG [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] (org.springframework.web.context.support.SpringBeanAutowiringSupport:processInjectionBasedOnCurrentContext:87) - Current WebApplicationContext is not available for processing of AuthenticationWs: Make sure this class gets constructed in a Spring web application. Proceeding without injection.

      As a result dependencies annotated with @Autowired are not set.

        Activity

        Hide
        michael.isvy Michael Isvy added a comment -

        I am wondering if this is Weblogic-specific. I am using Tomcat+CXF and I can see the same error message.

        Show
        michael.isvy Michael Isvy added a comment - I am wondering if this is Weblogic-specific. I am using Tomcat+CXF and I can see the same error message.
        Hide
        joerg_s Jörg Sischka added a comment -

        I don't think so. I see the same message on JBoss5.1 (for jdk6) with JBossWS-Metro.

        Show
        joerg_s Jörg Sischka added a comment - I don't think so. I see the same message on JBoss5.1 (for jdk6) with JBossWS-Metro.
        Hide
        juergen.hoeller Juergen Hoeller added a comment -

        I've revised this for Spring 3.0.1: not only checking the ClassLoader match now, but also storing a static WebApplicationContext reference if - and only if - the Spring libraries get deployed in the same web application as the ContextLoader. That should typically be the case if you add the Spring jars to your WEB-INF/lib directory.

        Juergen

        Show
        juergen.hoeller Juergen Hoeller added a comment - I've revised this for Spring 3.0.1: not only checking the ClassLoader match now, but also storing a static WebApplicationContext reference if - and only if - the Spring libraries get deployed in the same web application as the ContextLoader. That should typically be the case if you add the Spring jars to your WEB-INF/lib directory. Juergen
        Hide
        proxyprodigy Lucus Darnell added a comment -

        I am using version 3.0.2, but am still having the same problem. I am running on Tomcat and I still see the following error:

        14 Jun 2010 15:31:46 DEBUG org.springframework.web.context.support.SpringBeanAutowiringSupport - Current WebApplicationContext is not available for processing of CarpetWebservice: Make sure this class gets constructed in a Spring web application. Proceeding without injection.

        Does anyone else out there in Spring land have this working and / or know of a work around? Any help would be greatly appreciated.

        Thanks in advance...

        Show
        proxyprodigy Lucus Darnell added a comment - I am using version 3.0.2, but am still having the same problem. I am running on Tomcat and I still see the following error: 14 Jun 2010 15:31:46 DEBUG org.springframework.web.context.support.SpringBeanAutowiringSupport - Current WebApplicationContext is not available for processing of CarpetWebservice: Make sure this class gets constructed in a Spring web application. Proceeding without injection. Does anyone else out there in Spring land have this working and / or know of a work around? Any help would be greatly appreciated. Thanks in advance...
        Hide
        cbeams Chris Beams added a comment -

        Lucus,

        It's been quite a while since you reopened this issue; if it's still a concern for you, please create a new issue and mention this issue ID when doing so. Thanks!

        Show
        cbeams Chris Beams added a comment - Lucus, It's been quite a while since you reopened this issue; if it's still a concern for you, please create a new issue and mention this issue ID when doing so. Thanks!
        Hide
        bedla.czech Ivo Smid added a comment -

        I had same problem on WebLogic 10.3.2.0 and it was because Thread.currentThread().getContextClassLoader() called in ContextLoader.initWebApplicationContext (while web app is starting) method returns different classloader instance compared to classloader returned while calling .getContextClassLoader in ContextLoader.getCurrentWebApplicationContext method (while SpringBeanAutowiringSupport child instance is created inside http request context).
        I do not know why WLS behaves like this and I have solved it by calling SpringBeanAutowiringSupport.processInjectionBasedOnServletContext in "legacy" class constructor.

        Show
        bedla.czech Ivo Smid added a comment - I had same problem on WebLogic 10.3.2.0 and it was because Thread.currentThread().getContextClassLoader() called in ContextLoader.initWebApplicationContext (while web app is starting) method returns different classloader instance compared to classloader returned while calling .getContextClassLoader in ContextLoader.getCurrentWebApplicationContext method (while SpringBeanAutowiringSupport child instance is created inside http request context). I do not know why WLS behaves like this and I have solved it by calling SpringBeanAutowiringSupport.processInjectionBasedOnServletContext in "legacy" class constructor.

          People

          • Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            maximdim Dmitri Maximovich
            Last updater:
            Ivo Smid
          • Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 14 weeks, 2 days ago