Skip to content

Commit 55c1322

Browse files
committed
set spark version to 1.6.2 and throw original exception
1 parent 27d7690 commit 55c1322

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

beam/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
<properties>
3636
<beam.hadoop.version>2.3.0</beam.hadoop.version>
37-
<beam.spark.version>1.6.1</beam.spark.version>
37+
<beam.spark.version>1.6.2</beam.spark.version>
3838
<beam.beam.version>0.2.0-incubating</beam.beam.version>
3939
</properties>
4040

beam/src/main/java/org/apache/zeppelin/beam/StaticRepl.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public static String execute(String generatedClassName, String code) throws Exce
6969
boolean hasMain = false;
7070

7171
for (int j = 0; j < classes.get(i).getMethods().size(); j++) {
72-
if (classes.get(i).getMethods().get(j).getName().equals("main")) {
72+
if (classes.get(i).getMethods().get(j).getName().equals("main") && classes.get(i)
73+
.getMethods().get(j).getModifiers().toString().contains("static")) {
7374
mainClassName = classes.get(i).getName();
7475
hasMain = true;
7576
break;
@@ -83,8 +84,9 @@ public static String execute(String generatedClassName, String code) throws Exce
8384

8485
// if there isn't Main method, will retuen error
8586
if (mainClassName == null) {
86-
logger.error("Exception for Main method", "There isn't any class containing Main method.");
87-
throw new Exception("There isn't any class containing Main method.");
87+
logger.error("Exception for Main method", "There isn't any class "
88+
+ "containing static main method.");
89+
throw new Exception("There isn't any class containing static main method.");
8890
}
8991

9092
// replace name of class containing Main method with generated name
@@ -152,7 +154,7 @@ public static String execute(String generatedClassName, String code) throws Exce
152154
logger.error("Exception in Interpreter while execution", e);
153155
System.err.println(e);
154156
e.printStackTrace(newErr);
155-
throw new Exception(baosErr.toString());
157+
throw new Exception(baosErr.toString(), e);
156158

157159
} finally {
158160

0 commit comments

Comments
 (0)