I am new here, and I hope that you will help me. I have a javascript function and there i call a function like this:
var criticalDateStart = new Date(1525683802394);
var criticalDateEnd = new Date(1525770202394);
var users = enumerateUsers({
userId : userId,
criticalDateStart : criticalDateStart.getTime(),
criticalDateEnd : criticalDateEnd.getTime(),
});
Furthemore, I have a lambda function on the server, that looks like this:
Function<Object, Object> enumeratePatients = (arg) -> {
if (arg instanceof ScriptObjectMirror) {
ScriptObjectMirror _arg = (ScriptObjectMirror) arg;
Integer userId = (Integer) _arg.get("userId");
Long criticalDateStart = (Long)_arg.get("criticalDateStart");
Long criticalDateEnd = (Long)_arg.get("criticalDateEnd");
ResteasyClient client = new ResteasyClientBuilder().build();
ResteasyWebTarget rtarget = client.target(Url);
Rest rest = rtarget.proxy(Rest.class);
return rest.enumerateUsers(
new EnumerateUserParameter(
userId,
criticalDateStart,
criticalDateEnd));
}
return null;
};
But it returns an error
java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Long.
Where is the problem?
By the way, the error is at the long criticalDateStart
and end line.