{"action":"created","comment":{"url":"https://api.github.com/repos/apache/flink/pulls/comments/47919597","id":47919597,"diff_hunk":"@@ -574,8 +574,11 @@ private static String getEntryPointClassNameFromJar(URL jarFile) throws ProgramI\n \t}\n \t\n \tprivate static Class<?> loadMainClass(String className, ClassLoader cl) throws ProgramInvocationException {\n+\t\tClassLoader contextCl = null;\n \t\ttry {\n-\t\t\treturn Class.forName(className, true, cl);\n+\t\t\tcontextCl = Thread.currentThread().getContextClassLoader();\n+\t\t\tThread.currentThread().setContextClassLoader(cl);\n+\t\t\treturn Class.forName(className, false, cl);","path":"flink-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java","position":9,"original_position":9,"commit_id":"6b0464cc27b348664c754a27c2e6f4024bd039a9","original_commit_id":"6b0464cc27b348664c754a27c2e6f4024bd039a9","user":{"login":"mjsax","id":8959638,"avatar_url":"https://avatars.githubusercontent.com/u/8959638?v=3","gravatar_id":"","url":"https://api.github.com/users/mjsax","html_url":"https://github.com/mjsax","followers_url":"https://api.github.com/users/mjsax/followers","following_url":"https://api.github.com/users/mjsax/following{/other_user}","gists_url":"https://api.github.com/users/mjsax/gists{/gist_id}","starred_url":"https://api.github.com/users/mjsax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjsax/subscriptions","organizations_url":"https://api.github.com/users/mjsax/orgs","repos_url":"https://api.github.com/users/mjsax/repos","events_url":"https://api.github.com/users/mjsax/events{/privacy}","received_events_url":"https://api.github.com/users/mjsax/received_events","type":"User","site_admin":false},"body":"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.","created_at":"2015-12-17T15:37:15Z","updated_at":"2015-12-17T15:37:15Z","html_url":"https://github.com/apache/flink/pull/1457#discussion_r47919597","pull_request_url":"https://api.github.com/repos/apache/flink/pulls/1457","_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/47919597"},"html":{"href":"https://github.com/apache/flink/pull/1457#discussion_r47919597"},"pull_request":{"href":"https://api.github.com/repos/apache/flink/pulls/1457"}}},"pull_request":{"url":"https://api.github.com/repos/apache/flink/pulls/1457","id":53706088,"html_url":"https://github.com/apache/flink/pull/1457","diff_url":"https://github.com/apache/flink/pull/1457.diff","patch_url":"https://github.com/apache/flink/pull/1457.patch","issue_url":"https://api.github.com/repos/apache/flink/issues/1457","number":1457,"state":"open","locked":false,"title":"Set current class loader to user-class loader and disable class initialization.","user":{"login":"mjsax","id":8959638,"avatar_url":"https://avatars.githubusercontent.com/u/8959638?v=3","gravatar_id":"","url":"https://api.github.com/users/mjsax","html_url":"https://github.com/mjsax","followers_url":"https://api.github.com/users/mjsax/followers","following_url":"https://api.github.com/users/mjsax/following{/other_user}","gists_url":"https://api.github.com/users/mjsax/gists{/gist_id}","starred_url":"https://api.github.com/users/mjsax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjsax/subscriptions","organizations_url":"https://api.github.com/users/mjsax/orgs","repos_url":"https://api.github.com/users/mjsax/repos","events_url":"https://api.github.com/users/mjsax/events{/privacy}","received_events_url":"https://api.github.com/users/mjsax/received_events","type":"User","site_admin":false},"body":"This PR fixes class loading issues with regard to Clojure. It is required to execute a Clojure example via `bin/flink run`.\r\n\r\nThe Clojure example can be found here: https://github.com/mjsax/flink-external/tree/master/flink-clojure","created_at":"2015-12-15T13:58:54Z","updated_at":"2015-12-17T15:37:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b72aeeaf0da634666702fbaf5447a7c58da5daa7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/flink/pulls/1457/commits","review_comments_url":"https://api.github.com/repos/apache/flink/pulls/1457/comments","review_comment_url":"https://api.github.com/repos/apache/flink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/flink/issues/1457/comments","statuses_url":"https://api.github.com/repos/apache/flink/statuses/6b0464cc27b348664c754a27c2e6f4024bd039a9","head":{"label":"mjsax:clojureClassLoadingFix","ref":"clojureClassLoadingFix","sha":"6b0464cc27b348664c754a27c2e6f4024bd039a9","user":{"login":"mjsax","id":8959638,"avatar_url":"https://avatars.githubusercontent.com/u/8959638?v=3","gravatar_id":"","url":"https://api.github.com/users/mjsax","html_url":"https://github.com/mjsax","followers_url":"https://api.github.com/users/mjsax/followers","following_url":"https://api.github.com/users/mjsax/following{/other_user}","gists_url":"https://api.github.com/users/mjsax/gists{/gist_id}","starred_url":"https://api.github.com/users/mjsax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjsax/subscriptions","organizations_url":"https://api.github.com/users/mjsax/orgs","repos_url":"https://api.github.com/users/mjsax/repos","events_url":"https://api.github.com/users/mjsax/events{/privacy}","received_events_url":"https://api.github.com/users/mjsax/received_events","type":"User","site_admin":false},"repo":{"id":28905963,"name":"flink","full_name":"mjsax/flink","owner":{"login":"mjsax","id":8959638,"avatar_url":"https://avatars.githubusercontent.com/u/8959638?v=3","gravatar_id":"","url":"https://api.github.com/users/mjsax","html_url":"https://github.com/mjsax","followers_url":"https://api.github.com/users/mjsax/followers","following_url":"https://api.github.com/users/mjsax/following{/other_user}","gists_url":"https://api.github.com/users/mjsax/gists{/gist_id}","starred_url":"https://api.github.com/users/mjsax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjsax/subscriptions","organizations_url":"https://api.github.com/users/mjsax/orgs","repos_url":"https://api.github.com/users/mjsax/repos","events_url":"https://api.github.com/users/mjsax/events{/privacy}","received_events_url":"https://api.github.com/users/mjsax/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mjsax/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/mjsax/flink","forks_url":"https://api.github.com/repos/mjsax/flink/forks","keys_url":"https://api.github.com/repos/mjsax/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mjsax/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mjsax/flink/teams","hooks_url":"https://api.github.com/repos/mjsax/flink/hooks","issue_events_url":"https://api.github.com/repos/mjsax/flink/issues/events{/number}","events_url":"https://api.github.com/repos/mjsax/flink/events","assignees_url":"https://api.github.com/repos/mjsax/flink/assignees{/user}","branches_url":"https://api.github.com/repos/mjsax/flink/branches{/branch}","tags_url":"https://api.github.com/repos/mjsax/flink/tags","blobs_url":"https://api.github.com/repos/mjsax/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mjsax/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mjsax/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/mjsax/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mjsax/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/mjsax/flink/languages","stargazers_url":"https://api.github.com/repos/mjsax/flink/stargazers","contributors_url":"https://api.github.com/repos/mjsax/flink/contributors","subscribers_url":"https://api.github.com/repos/mjsax/flink/subscribers","subscription_url":"https://api.github.com/repos/mjsax/flink/subscription","commits_url":"https://api.github.com/repos/mjsax/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/mjsax/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/mjsax/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/mjsax/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/mjsax/flink/contents/{+path}","compare_url":"https://api.github.com/repos/mjsax/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mjsax/flink/merges","archive_url":"https://api.github.com/repos/mjsax/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mjsax/flink/downloads","issues_url":"https://api.github.com/repos/mjsax/flink/issues{/number}","pulls_url":"https://api.github.com/repos/mjsax/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/mjsax/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/mjsax/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mjsax/flink/labels{/name}","releases_url":"https://api.github.com/repos/mjsax/flink/releases{/id}","created_at":"2015-01-07T08:38:24Z","updated_at":"2015-05-05T14:52:09Z","pushed_at":"2015-12-15T13:16:06Z","git_url":"git://github.com/mjsax/flink.git","ssh_url":"git@github.com:mjsax/flink.git","clone_url":"https://github.com/mjsax/flink.git","svn_url":"https://github.com/mjsax/flink","homepage":null,"size":68971,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"d9a061c674a0e64e6ec419ff614347ecc08d4eb6","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":20587599,"name":"flink","full_name":"apache/flink","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/flink","description":"Mirror of Apache Flink","fork":false,"url":"https://api.github.com/repos/apache/flink","forks_url":"https://api.github.com/repos/apache/flink/forks","keys_url":"https://api.github.com/repos/apache/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/flink/teams","hooks_url":"https://api.github.com/repos/apache/flink/hooks","issue_events_url":"https://api.github.com/repos/apache/flink/issues/events{/number}","events_url":"https://api.github.com/repos/apache/flink/events","assignees_url":"https://api.github.com/repos/apache/flink/assignees{/user}","branches_url":"https://api.github.com/repos/apache/flink/branches{/branch}","tags_url":"https://api.github.com/repos/apache/flink/tags","blobs_url":"https://api.github.com/repos/apache/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/flink/languages","stargazers_url":"https://api.github.com/repos/apache/flink/stargazers","contributors_url":"https://api.github.com/repos/apache/flink/contributors","subscribers_url":"https://api.github.com/repos/apache/flink/subscribers","subscription_url":"https://api.github.com/repos/apache/flink/subscription","commits_url":"https://api.github.com/repos/apache/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/flink/contents/{+path}","compare_url":"https://api.github.com/repos/apache/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/flink/merges","archive_url":"https://api.github.com/repos/apache/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/flink/downloads","issues_url":"https://api.github.com/repos/apache/flink/issues{/number}","pulls_url":"https://api.github.com/repos/apache/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/flink/labels{/name}","releases_url":"https://api.github.com/repos/apache/flink/releases{/id}","created_at":"2014-06-07T07:00:10Z","updated_at":"2015-12-17T06:18:49Z","pushed_at":"2015-12-17T14:20:41Z","git_url":"git://github.com/apache/flink.git","ssh_url":"git@github.com:apache/flink.git","clone_url":"https://github.com/apache/flink.git","svn_url":"https://github.com/apache/flink","homepage":null,"size":86557,"stargazers_count":816,"watchers_count":816,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":548,"mirror_url":"git://git.apache.org/flink.git","open_issues_count":74,"forks":548,"open_issues":74,"watchers":816,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/1457"},"html":{"href":"https://github.com/apache/flink/pull/1457"},"issue":{"href":"https://api.github.com/repos/apache/flink/issues/1457"},"comments":{"href":"https://api.github.com/repos/apache/flink/issues/1457/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/flink/pulls/1457/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/flink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/flink/pulls/1457/commits"},"statuses":{"href":"https://api.github.com/repos/apache/flink/statuses/6b0464cc27b348664c754a27c2e6f4024bd039a9"}}}}