Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-682

Invoker Class should be created in Thread Context Classloader

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • 0.3.0-incubating
    • 2.3.0
    • sdk-java-core
    • Important

    Description

      As of now the InvokerClass is being loaded in wrong classloader. It should be loaded into Thread.currentThread.getContextClassLoader()

      https://github.com/apache/incubator-beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvokers.java#L167

       Class<? extends DoFnInvoker<?, ?>> res =
              (Class<? extends DoFnInvoker<?, ?>>)
                  unloaded
                      .load(DoFnInvokers.class.getClassLoader(), ClassLoadingStrategy.Default.INJECTION)
                      .getLoaded();
      
      

      Fix

       Class<? extends DoFnInvoker<?, ?>> res =
              (Class<? extends DoFnInvoker<?, ?>>)
                  unloaded
                      .load(Thread.currentThread().getContextClassLoader(),
                              ClassLoadingStrategy.Default.INJECTION)
                      .getLoaded();
      

      Attachments

        Activity

          People

            romain.manni-bucau Romain Manni-Bucau
            sumitkchawla Sumit Chawla
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: