java plugin: Improve an error message.
[collectd.git] / src / java.c
index e029a0b..5fda742 100644 (file)
@@ -1931,7 +1931,9 @@ static int cjni_init_native (JNIEnv *jvm_env) /* {{{ */
   api_class_ptr = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/Collectd");
   if (api_class_ptr == NULL)
   {
-    ERROR ("cjni_init_native: Cannot find API class `org/collectd/api/Collectd'.");
+    ERROR ("cjni_init_native: Cannot find the API class \"org.collectd.api"
+        ".Collectd\". Please set the correct class path "
+        "using 'JVMArg \"-Djava.class.path=...\"'.");
     return (-1);
   }
 
@@ -2410,6 +2412,7 @@ static int cjni_config_callback (oconfig_item_t *ci) /* {{{ */
   memcpy (config_block->children + config_block->children_num,
       ci_copy->children,
       ci_copy->children_num * sizeof (*ci_copy->children));
+  config_block->children_num += ci_copy->children_num;
 
   /* Delete the pointers from the copy, so `oconfig_free' can't free them. */
   memset (ci_copy->children, 0,