Repository: zeppelin Updated Branches: refs/heads/master 5cdc02d36 -> 88476c38a
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 Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/88476c38 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/88476c38 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/88476c38 Branch: refs/heads/master Commit: 88476c38ac4fa13b51f15d0d7fa59e0e8335eb9b Parents: 5cdc02d 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:41 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/88476c38/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 0407e6e..8a7e4c9 100644 --- a/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java +++ b/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java @@ -260,7 +260,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; @@ -577,8 +577,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}); } @@ -1131,17 +1131,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;
