Github user mjsax commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1457#discussion_r47919597
  
    --- Diff: 
flink-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java
 ---
    @@ -574,8 +574,11 @@ private static String 
getEntryPointClassNameFromJar(URL jarFile) throws ProgramI
        }
        
        private static Class<?> loadMainClass(String className, ClassLoader cl) 
throws ProgramInvocationException {
    +           ClassLoader contextCl = null;
                try {
    -                   return Class.forName(className, true, cl);
    +                   contextCl = 
Thread.currentThread().getContextClassLoader();
    +                   Thread.currentThread().setContextClassLoader(cl);
    +                   return Class.forName(className, false, cl);
    --- End diff --
    
    Required for the Clojure case. If we initialize right here, the `main` 
method gets invoked right away. This is too early as not everything got set up 
properly at this point by the client and the execution fails.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to