I created a module to get local files via server, but errors happen to
PerspectiveSessionCollection psc = (PerspectiveSessionCollection) sess.getAttribute("perspective-session");
as below:
java.lang.ClassCastException: class com.inductiveautomation.perspective.gateway.session.PerspectiveSessionCollection cannot be cast to class com.inductiveautomation.perspective.gateway.session.PerspectiveSessionCollection (com.inductiveautomation.perspective.gateway.session.PerspectiveSessionCollection is in unnamed module of loader com.inductiveautomation.ignition.gateway.modules.ModuleClassLoader @7855ca07; com.inductiveautomation.perspective.gateway.session.PerspectiveSessionCollection is in unnamed module of loader com.inductiveautomation.ignition.gateway.modules.ModuleClassLoader @4d028b45)
How to use perspective session in proper way, any examples would be appreciated!
Is your module marked as depending on Perspective in your module.xml? Without that, you'll be loaded in an isolated class loader without automatic access to any other module's classes, though you can ask the module manager to resolve any class by name.
It cann't find class if it is provided scope.
java.lang.NoClassDefFoundError: com/inductiveautomation/perspective/gateway/session/PerspectiveSessionCollection