You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/09/27 02:47:20 UTC

[jira] [Commented] (BEAM-682) Invoker Class should be created in Thread Context Classloader

    [ https://issues.apache.org/jira/browse/BEAM-682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15524854#comment-15524854 ] 

ASF GitHub Bot commented on BEAM-682:
-------------------------------------

GitHub user sumitchawla opened a pull request:

    https://github.com/apache/incubator-beam/pull/1013

    BEAM-682-Invoker Class should be created in Thread Context Classloader

    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();

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sumitchawla/incubator-beam classloader_fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-beam/pull/1013.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1013
    
----
commit ecb7fc6c7ec7b0a2016f7da5edf9cf7f3bc9ace4
Author: Sumit Chawla <su...@cisco.com>
Date:   2016-09-27T02:45:22Z

    BEAM-682-Invoker Class should be created in Thread Context Classloader

----


> Invoker Class should be created in Thread Context Classloader
> -------------------------------------------------------------
>
>                 Key: BEAM-682
>                 URL: https://issues.apache.org/jira/browse/BEAM-682
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>    Affects Versions: 0.3.0-incubating
>            Reporter: Sumit Chawla
>            Assignee: Sumit Chawla
>            Priority: Critical
>
> 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
> {code}
>  Class<? extends DoFnInvoker<?, ?>> res =
>         (Class<? extends DoFnInvoker<?, ?>>)
>             unloaded
>                 .load(DoFnInvokers.class.getClassLoader(), ClassLoadingStrategy.Default.INJECTION)
>                 .getLoaded();
> {code}
> Fix 
> {code}
>  Class<? extends DoFnInvoker<?, ?>> res =
>         (Class<? extends DoFnInvoker<?, ?>>)
>             unloaded
>                 .load(Thread.currentThread().getContextClassLoader(),
>                         ClassLoadingStrategy.Default.INJECTION)
>                 .getLoaded();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)