Hi,
I’m quite new with Ignition SDK and this is my first post here so please be patient
I created a module that exposes some methods so they are available as functions in Jython scripts. Module performs some initializations in the gateway hook and amongst other things instantiates a singleton class.
I’m receiving the following error when calling one of the functions in a Jython script at designer or client scope (it works OK at gateway scope):
ClassNotFoundException: com.inductiveautomation.ignition.gateway.datasource.query.DBQuery$StreamingHandler).
In module.xml I added my module JAR for the 3 scopes (e.g. MyModule.jar). I also added there the 3 “hooks” (client, designer and gateway) where I expose my methods to the different scopes. In those hooks I invoke addScriptModule with an instance of my API class as a parameter. None of the API methods call directly DBQuery class.
DBQuery.StreamingHandler is not invoked directly on the exposed method, but depending on some situations it will call different chained classes until reaching a class using DBQuery. What should I do to fix this issue? Is there a way to have a function at client or designer scope indirectly invoking some class defined only at gateway level?
On the other hand, this leads to a second question: in principle this class not found error should not have happened when calling the function in Jython, as at module startup a singleton class -mentioned at the top- was created in the gateway hook (this class uses DBQuery after creating the instance to load some data). So it seems singleton instance created at module startup in the gateway hook is not visible in the other scopes as those end up creating separate instances. Is possible all scopes “see” the same instance? Thanks in advance!