In Developer, I created a form that displays client information using the plugin method plugins.clientmanager.getConnectedClients() which returns an array of cient objects (the form displays the client info). However, when I deploy this same code at a customer site, the method plugins.clientmanager.getConnectedClients() always returns a null even though the customer has both Smart and Web clients active. Why does the code work in Developer but not on the Server? Perhaps, I missing something such as a server setting? Any suggestions?
The code fails on the first line (below, for reference) when run on a smart client in a production environment (Servoy server). However, it works when run in Developer. In the production environment, the variable aClients is always null even when smart and web clients are active (as viewed/confirmed in the Servoy admin Clients screen). The test for !aClients was added to detect the null condition.
/** @type {JSClientInformation} */
var aClients = plugins.clientmanager.getConnectedClients()
if ( !aClients )
{
var message = 'Cannot obtain list of connected clients.'
plugins.dialogs.showInfoDialog( 'Connected Clients', message, 'OK' )
return
}
There is nothing in the log file (servoy_log.txt) that pertains directly to this problem. There are a few entries regarding connection resets:
2017-12-18 05:58:16,123 ERROR [ClientExportNotifyListner[89]] com.servoy.j2db.util.Debug - Signalling channel lost when reading pings or client export notifies, removing ports: [3089]
java.net.SocketException: Connection reset
I have a specific guess on what the problem is. If you try that in a web client, will it work? And if you have the chance to enable a Java console in the smart client, you would probably see an error there.
I am unable to run our main solution as a web client (it was designed for smart client only). I was able to capture an error in the Java console (see below). Note the exception Caused by line in the error message…RMI class loader disabled. Was this your guess, and is it something I can fix? FYI…The JRE on the production server is 1.8.0_121 (same as on Developer).
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: com.servoy.j2db.server.main.Zcb (no security manager: RMI class loader disabled)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
at com.sun.proxy.$Proxy20.getConnectedClients(Unknown Source)
at com.servoy.extensions.plugins.clientmanager.ClientManagerProvider.js_getConnectedClients(ClientManagerProvider.java:120)
at com.servoy.extensions.plugins.clientmanager.ClientManagerProvider.js_getConnectedClients(ClientManagerProvider.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:158)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:312)
at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:107)
at org.mozilla.javascript.gen.ARM_user_forms_user_client_browse_getFoundsetClients_60._c_getFoundsetClients_0(ARM_user/forms/user_client_browse/getFoundsetClients:154)
at org.mozilla.javascript.gen.ARM_user_forms_user_client_browse_getFoundsetClients_60.call(ARM_user/forms/user_client_browse/getFoundsetClients)
at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:97)
at org.mozilla.javascript.gen.ARM_user_forms_user_client_browse_onShow_59._c_onShow_0(ARM_user/forms/user_client_browse/onShow:60)
at org.mozilla.javascript.gen.ARM_user_forms_user_client_browse_onShow_59.call(ARM_user/forms/user_client_browse/onShow)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:665)
at com.servoy.j2db.BasicFormController.executeFunction(BasicFormController.java:1063)
at com.servoy.j2db.BasicFormController.executeFormMethod(BasicFormController.java:782)
at com.servoy.j2db.BasicFormController.executeOnShowMethod(BasicFormController.java:651)
at com.servoy.j2db.BasicFormController.access$2(BasicFormController.java:645)
at com.servoy.j2db.BasicFormController$1.run(BasicFormController.java:385)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.WaitDispatchSupport$2.run(Unknown Source)
at java.awt.WaitDispatchSupport$4.run(Unknown Source)
at java.awt.WaitDispatchSupport$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(Unknown Source)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.servoy.j2db.util.gui.JEscapeDialog.setVisible(JEscapeDialog.java:170)
at com.servoy.j2db.gui.FormDialog.setVisible(FormDialog.java:164)
at com.servoy.j2db.smart.SwingRuntimeWindow.finalizeShowWindow(SwingRuntimeWindow.java:875)
at com.servoy.j2db.smart.SwingRuntimeWindow.doOldShowInDialog(SwingRuntimeWindow.java:511)
at com.servoy.j2db.smart.SwingRuntimeWindow.doOldShow(SwingRuntimeWindow.java:420)
at com.servoy.j2db.scripting.RuntimeWindow.doShow(RuntimeWindow.java:304)
at com.servoy.j2db.scripting.RuntimeWindow.show(RuntimeWindow.java:298)
at com.servoy.j2db.scripting.RuntimeWindow.showObject(RuntimeWindow.java:285)
at com.servoy.j2db.scripting.JSWindow.js_show(JSWindow.java:155)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:158)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:312)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:62)
at org.mozilla.javascript.gen.ARM_core_scopes_globals_showInModalWindow_48._c_showInModalWindow_0(ARM_core/scopes/globals/showInModalWindow:2291)
at org.mozilla.javascript.gen.ARM_core_scopes_globals_showInModalWindow_48.call(ARM_core/scopes/globals/showInModalWindow)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:78)
at org.mozilla.javascript.gen.ARM_manager_forms_manager_ACTION_buttonUsers_47._c_ACTION_buttonUsers_0(ARM_manager/forms/manager/ACTION_buttonUsers:10)
at org.mozilla.javascript.gen.ARM_manager_forms_manager_ACTION_buttonUsers_47.call(ARM_manager/forms/manager/ACTION_buttonUsers)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:406)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3204)
at org.mozilla.javascript.gen.ARM_manager_forms_manager_ACTION_buttonUsers_47.call(ARM_manager/forms/manager/ACTION_buttonUsers)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:665)
at com.servoy.j2db.BasicFormController.executeFunction(BasicFormController.java:1063)
at com.servoy.j2db.BasicFormController.executeFunction(BasicFormController.java:945)
at com.servoy.j2db.BasicFormController.executeFunction(BasicFormController.java:812)
at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:1041)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:299)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:265)
at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:233)
at com.servoy.j2db.smart.dataui.AbstractScriptLabel$5.mouseReleased(AbstractScriptLabel.java:929)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.servoy.j2db.server.main.Zcb (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
at com.sun.deploy.util.DeployRMIClassLoaderSpi.loadClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at sun.rmi.server.UnicastRef.unmarshalValue(Unknown Source)
… 110 more