Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-2051

Blueprint Spring SpringApplicationContext ClassLoader implementation not working for loadClass(name, resolve) operation

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: blueprint-spring-1.0.0
    • Fix Version/s: None
    • Component/s: Blueprint
    • Labels:
      None

      Description

      Blueprint Spring SpringApplicationContext uses its own ClassLoader.

      This class loader implementation however is not handling calls to loadClass(String name, boolean resolve), which is used by other class loaders.
      Therefore if we obtain class loader for app context and use it for example with Groovy, it will fail asĀ 

      @Override
      public Class<?> loadClass(String name) throws ClassNotFoundException...

      Will not be called at all.

      Proper implementation should be:

      @Override
      public Class<?> loadClass(String name) throws ClassNotFoundException {
          return loadClass(name, false);
      }
      
      @Override
      public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
          for (ClassLoader cl : parentClassLoaders) {
              try {
                  Class<?> c = cl.loadClass(name);
                  if (resolve) {
                      resolveClass(c);
                  }
                  return c;
              } catch (ClassNotFoundException e) {
                  // Ignore
              }
          }
          throw new ClassNotFoundException(name);
      } 

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nannou9 Piotr Klimczak

              Dates

              • Created:
                Updated:

                Issue deployment