summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-08-10 14:57:42 +0200
committerDave Wallace <dwallacelf@gmail.com>2017-08-14 14:39:16 +0000
commit3214dc382342573c242782849d98c23009960633 (patch)
tree9eee8ceb066ec23ac03a9e2bdc9eb3d62033ce5d /src
parent4aef5b78e71feb63ff883395c041edf48d8b516f (diff)
jvpp: ignore messages if callback method is missing (VPP-548)
Change-Id: I6a06dbcd8339bd6645a6b02ae70154aa0885dcf8 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
index 1425cdb7a8f..7e59cc4c785 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
@@ -226,11 +226,19 @@ static void vl_api_${handler_name}_t_handler (vl_api_${handler_name}_t * mp)
{
${plugin_name}_main_t *plugin_main = &${plugin_name}_main;
JNIEnv *env = jvpp_main.jenv;
+ jthrowable exc;
$err_handler
jmethodID constructor = (*env)->GetMethodID(env, ${class_ref_name}Class, "<init>", "()V");
jmethodID callbackMethod = (*env)->GetMethodID(env, plugin_main->callbackClass, "on${dto_name}", "(Lio/fd/vpp/jvpp/${plugin_name}/dto/${dto_name};)V");
+ exc = (*env)->ExceptionOccurred(env);
+ if (exc) {
+ clib_warning("Unable to extract on${dto_name} method reference from ${plugin_name} plugin's callbackClass. Ignoring message.\\n");
+ (*env)->ExceptionDescribe(env);
+ (*env)->ExceptionClear(env);
+ return;
+ }
jobject dto = (*env)->NewObject(env, ${class_ref_name}Class, constructor);
$dto_setters