I have developed a module to use a REST API. One function returns a JSONObject. I started by debugging the functions in the Abstract Script Module and everything was working fine. Then I moved the script into a Impl function in the Gateway Script Module and I started getting and error.
Traceback (most recent call last):
File “event:actionPerformed”, line 45, in
java.lang.reflect.UndeclaredThrowableException: java.lang.reflect.UndeclaredThrowableException
caused by UndeclaredThrowableException
caused by GatewayException: class org.json.JSONObject cannot be cast to class java.io.Serializable (org.json.JSONObject is in unnamed module of loader 'app'; java.io.Serializable is in module java.base of loader 'bootstrap')
caused by ClassCastException: class org.json.JSONObject cannot be cast to class java.io.Serializable (org.json.JSONObject is in unnamed module of loader 'app'; java.io.Serializable is in module java.base of loader 'bootstrap')
Ignition v8.0.14 (b2020062220)
I’m not doing any casting to Serialized in my scripting.
It seems as though the rpc is trying to convert the JSONObject?