When invoking a method on an com.sun.jdi.ObjectReference instance, you have to provide some options: either INVOKE_SINGLE_THREADED, or INVOKE_NONVIRTUAL.
invokeMethod(ThreadReference thread, Method method, List<? extends Value> arguments, int options)
According to the Javadoc:
INVOKE_SINGLE_THREADED: Perform method invocation with only the invoking thread resumed
INVOKE_NONVIRTUAL: Perform non-virtual method invocation
But I am still confused what these options mean.