in core/java8/proxy/src/main/java/org/apache/openwhisk/runtime/java/action/JarLoader.java [57:77]
public JarLoader(Path jarPath, String entrypoint)
throws MalformedURLException, ClassNotFoundException, NoSuchMethodException, SecurityException {
super(new URL[] { jarPath.toUri().toURL() });
final String[] splittedEntrypoint = entrypoint.split("#");
final String entrypointClassName = splittedEntrypoint[0];
this.mainClass = loadClass(entrypointClassName);
this.entrypointMethodName = splittedEntrypoint.length > 1 ? splittedEntrypoint[1] : "main";
Method[] methods = mainClass.getDeclaredMethods();
Boolean existMain = false;
for(Method method: methods) {
if (method.getName().equals(this.entrypointMethodName)) {
existMain = true;
break;
}
}
if (!existMain) {
throw new NoSuchMethodException(this.entrypointMethodName);
}
}