flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject flink git commit: [FLINK-4236] fix error handling for jar files with no main method
Date Sat, 13 Aug 2016 16:07:33 GMT
Repository: flink
Updated Branches:
  refs/heads/release-1.1 58c810aea -> f67cb89d4


[FLINK-4236] fix error handling for jar files with no main method

This change shows only entry classes with a valid main method. It
ignores classes which contain no main method.

This closes #2347


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/f67cb89d
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/f67cb89d
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/f67cb89d

Branch: refs/heads/release-1.1
Commit: f67cb89d4934d8ebb2d04d3a2c020c9702b99934
Parents: 58c810a
Author: Maximilian Michels <mxm@apache.org>
Authored: Wed Aug 10 12:08:23 2016 +0200
Committer: Maximilian Michels <mxm@apache.org>
Committed: Sat Aug 13 18:07:08 2016 +0200

----------------------------------------------------------------------
 .../runtime/webmonitor/handlers/JarListHandler.java     | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/f67cb89d/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java
----------------------------------------------------------------------
diff --git a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java
b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java
index ede80a3..c263628 100644
--- a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java
+++ b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java
@@ -20,7 +20,6 @@ package org.apache.flink.runtime.webmonitor.handlers;
 
 import com.fasterxml.jackson.core.JsonGenerator;
 import org.apache.flink.client.program.PackagedProgram;
-import org.apache.flink.client.program.ProgramInvocationException;
 import org.apache.flink.runtime.instance.ActorGateway;
 import org.apache.flink.runtime.webmonitor.RuntimeMonitorHandler;
 
@@ -94,20 +93,23 @@ public class JarListHandler implements RequestHandler {
 				} catch (IOException ignored) {
 					// we simply show no entries here
 				}
-				
+
 				// show every entry class that can be loaded later on.
-				PackagedProgram program;
 				for (String clazz : classes) {
 					clazz = clazz.trim();
+
+					PackagedProgram program = null;
 					try {
 						program = new PackagedProgram(f, clazz, new String[0]);
+					} catch (Exception ignored) {
+						// ignore jar files which throw an error upon creating a PackagedProgram
+					}
+					if (program != null) {
 						gen.writeStartObject();
 						gen.writeStringField("name", clazz);
 						String desc = program.getDescription();
 						gen.writeStringField("description", desc == null ? "No description provided" : desc);
 						gen.writeEndObject();
-					} catch (ProgramInvocationException e) {
-						//
 					}
 				}
 				gen.writeEndArray();


Mime
View raw message