}
/* Set the `interval' member.. */
- status = ctoj_long (jvm_env, (jlong) vl->interval,
+ status = ctoj_long (jvm_env,
+ (jlong) CDTIME_T_TO_MS (vl->interval),
c_valuelist, o_valuelist, "setInterval");
if (status != 0)
{
return (NULL);
}
- /* Set the `interval' member.. */
+ /* Set the `severity' member.. */
status = ctoj_int (jvm_env, (jint) n->severity,
c_notification, o_notification, "setSeverity");
if (status != 0)
return (-1);
}
/* Java measures time in milliseconds. */
- vl->time = (time_t) (tmp_long / ((jlong) 1000));
+ vl->time = MS_TO_CDTIME_T (tmp_long);
status = jtoc_long (jvm_env, &tmp_long,
class_ptr, object_ptr, "getInterval");
ERROR ("java plugin: jtoc_value_list: jtoc_long (getInterval) failed.");
return (-1);
}
- vl->interval = (int) tmp_long;
+ vl->interval = MS_TO_CDTIME_T (tmp_long);
status = jtoc_values_array (jvm_env, ds, vl, class_ptr, object_ptr);
if (status != 0)
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);
}