Repository: zeppelin Updated Branches: refs/heads/branch-0.6 754553233 -> 1fcfe5dca
ZEPPELIN-1222. ClassNotFoundException of SparkJLineCompletion in Spark Interpreter ### What is this PR for? ClassNotFoundException happens because not fully qualified class name is specified. Specify the fully qualified class name in this PR, and remove method findClass in SparkInterpter, use findClass in Utils instead. ### What type of PR is it? [Bug Fix] ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-1222 ### How should this be tested? Manually verified, restart zeppelin server and spark interpreter, this issue is gone. ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Jeff Zhang <[email protected]> Closes #1212 from zjffdu/SPARK-1222 and squashes the following commits: bbe42a6 [Jeff Zhang] ZEPPELIN-1222. ClassNotFoundException of SparkJLineCompletion in Spark Interpreter (cherry picked from commit 88476c38ac4fa13b51f15d0d7fa59e0e8335eb9b) Signed-off-by: Lee moon soo <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/1fcfe5dc Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/1fcfe5dc Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/1fcfe5dc Branch: refs/heads/branch-0.6 Commit: 1fcfe5dca283f2b9c13a0933b8a4b869e53b047c Parents: 7545532 Author: Jeff Zhang <[email protected]> Authored: Thu Jul 21 11:17:06 2016 +0800 Committer: Lee moon soo <[email protected]> Committed: Fri Jul 22 12:02:54 2016 +0900 ---------------------------------------------------------------------- .../apache/zeppelin/spark/SparkInterpreter.java | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1fcfe5dc/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java ---------------------------------------------------------------------- diff --git a/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java b/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java index ba7f1ec..9c2fe36 100644 --- a/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java +++ b/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java @@ -258,7 +258,7 @@ public class SparkInterpreter extends Interpreter { jars = (String[]) Utils.invokeStaticMethod(SparkILoop.class, "getAddedJars"); } else { jars = (String[]) Utils.invokeStaticMethod( - findClass("org.apache.spark.repl.Main"), "getAddedJars"); + Utils.findClass("org.apache.spark.repl.Main"), "getAddedJars"); } String classServerUri = null; @@ -575,8 +575,8 @@ public class SparkInterpreter extends Interpreter { } completor = Utils.instantiateClass( - "SparkJLineCompletion", - new Class[]{findClass("org.apache.spark.repl.SparkIMain")}, + "org.apache.spark.repl.SparkJLineCompletion", + new Class[]{Utils.findClass("org.apache.spark.repl.SparkIMain")}, new Object[]{intp}); } @@ -1116,17 +1116,6 @@ public class SparkInterpreter extends Interpreter { return sparkVersion; } - - - private Class findClass(String name) { - try { - return this.getClass().forName(name); - } catch (ClassNotFoundException e) { - logger.error(e.getMessage(), e); - return null; - } - } - private File createTempDir(String dir) { File file = null;
