OK, in that case I'd suggest taking a look at the API requests (as
received by ZAP). You can enable debug logging by running a Stand Alone
JavaScript with:
org.apache.log4j.Logger.getLogger("org.zaproxy.zap.extension.api.API").setLevel(org.apache.log4j.Level.DEBUG);
Or, editing the file log4j.properties (in home dir [1]) to have:
log4j.logger.org.zaproxy.zap.extension.api.API=DEBUG
The API requests will by logged to zap.log (in home dir), that should
help spot what might be wrong with the API requests sent by the Java client.
(Note that the requests sent by the ZAP API UI might have some extra
parameters, "zapapiformat" and "formMethod", that's expected and
shouldn't cause any issue.)
[1]
https://github.com/zaproxy/zaproxy/wiki/FAQconfig
Best regards.