Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-3728

Context class loader not restored correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4, nightly
    • None
    • None

    Description

      has the following code:
      AsyncResponse.java does not restore the context classloader correctly. For example:

      protected void onError(Throwable flt, MessageContext mc, ClassLoader cl) {
      setThreadClassLoader(cl);
      onError(flt, mc);
      ClassLoader origClassLoader = (ClassLoader)AccessController.doPrivileged(new PrivilegedAction() {
      public Object run()

      { return Thread.currentThread().getContextClassLoader(); }

      });
      setThreadClassLoader(origClassLoader);
      }

      The origClassLoader is retrieved after new class loader is already set on the thread so really origClassLoader == cl. The origClassLoader should be obtained before the first setThreadClassLoader(cl) call. Same problem applies to onCompleted() call.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gawor@mcs.anl.gov Jarek Gawor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: