Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.5, 1.6.0
    • Component/s: None
    • Labels:
      None

      Description

      Currently Axis2 follows the parent first class loading for service and module loading.

      The reason for this is it uses DeploymentClassLoader loader which is extended from the ClassLoader class.

      The loadClass method of the ClassLoader class looks like this.

      protected synchronized Class<?> loadClass(String name, boolean resolve)
      throws ClassNotFoundException
      {
      // First, check if the class has already been loaded
      Class c = findLoadedClass(name);
      if (c == null) {
      try {
      if (parent != null)

      { c = parent.loadClass(name, false); }

      else

      { c = findBootstrapClass0(name); }

      } catch (ClassNotFoundException e)

      { // If still not found, then invoke findClass in order // to find the class. c = findClass(name); }

      }
      if (resolve)

      { resolveClass(c); }

      return c;
      }

      it first check for parent class loader classes and then for its classes. So we can add child first class loading simply reversing this order in a override loadClass method as follows.

      protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {

      Class c = findLoadedClass(name);
      if (c == null) {
      try

      { c = findClass(name); }

      catch (Exception e)

      { c = super.loadClass(name, resolve); }

      }
      return c;
      }

      1. child_first_class_loading.patch
        0.7 kB
        Amila Chinthaka Suriarachchi
      2. classloaderpatch.txt
        20 kB
        Amila Chinthaka Suriarachchi

        Issue Links

          Activity

          Amila Chinthaka Suriarachchi created issue -
          Hide
          Amila Chinthaka Suriarachchi added a comment -

          patch for review.

          Show
          Amila Chinthaka Suriarachchi added a comment - patch for review.
          Amila Chinthaka Suriarachchi made changes -
          Field Original Value New Value
          Attachment child_first_class_loading.patch [ 12408250 ]
          Hide
          Amila Chinthaka Suriarachchi added a comment -

          attach a patch so that child first class loading can be set using axis2.xml parameter level.

          Show
          Amila Chinthaka Suriarachchi added a comment - attach a patch so that child first class loading can be set using axis2.xml parameter level.
          Amila Chinthaka Suriarachchi made changes -
          Attachment classloaderpatch.txt [ 12408378 ]
          Hide
          Deepal Jayasinghe added a comment -

          go for it.

          Show
          Deepal Jayasinghe added a comment - go for it.
          Hide
          Andreas Veithen added a comment -

          This was actually implemented by r776555 and r776612.

          Show
          Andreas Veithen added a comment - This was actually implemented by r776555 and r776612.
          Andreas Veithen made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.6 [ 12313622 ]
          Resolution Fixed [ 1 ]
          Hide
          Andreas Veithen added a comment -

          Merged this to the 1.5 branch because it helps improving support of Axis2 on WAS 7.0.

          Show
          Andreas Veithen added a comment - Merged this to the 1.5 branch because it helps improving support of Axis2 on WAS 7.0.
          Andreas Veithen made changes -
          Fix Version/s 1.5.5 [ 12316011 ]
          Andreas Veithen made changes -
          Link This issue blocks AXIS2-4917 [ AXIS2-4917 ]
          Gavin made changes -
          Link This issue blocks AXIS2-4917 [ AXIS2-4917 ]
          Gavin made changes -
          Link This issue is depended upon by AXIS2-4917 [ AXIS2-4917 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Amila Chinthaka Suriarachchi
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development