Hi Servoy,
After the update to RC4 or RC5 (not sure when exactly), we started to see the following errors in the server log:
AWT-EventQueue-0 ERROR com.servoy.j2db.util.Debug No selection set on foundset with size 1 fs: FoundSet[Table:id_approver,Size: 1,CachedRecords: 1,SELECTED INDEX: -1]
java.lang.RuntimeException
at com.servoy.j2db.scripting.SelectedRecordScope.getSelectedRecord(SelectedRecordScope.java:47)
at com.servoy.j2db.scripting.SelectedRecordScope.get(SelectedRecordScope.java:105)
at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1641)
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1739)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1678)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3752)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:518)
at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:379)
at com.servoy.j2db.FormController.executeFunction(FormController.java:4050)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3929)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3851)
at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3706)
at com.servoy.j2db.ui.RenderEventExecutor.fireOnRender(RenderEventExecutor.java:88)
at com.servoy.j2db.smart.dataui.DataRenderer.fireDataRendererOnRender(DataRenderer.java:843)
at com.servoy.j2db.smart.dataui.DataRenderer.getListCellRendererComponent(DataRenderer.java:540)
at com.servoy.j2db.smart.RecordView.syncSliderAndRefresh(RecordView.java:224)
at com.servoy.j2db.smart.RecordView.valueChanged(RecordView.java:333)
at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.insertIndexInterval(Unknown Source)
at com.servoy.j2db.util.model.AlwaysRowSelectedSelectionModel.insertIndexInterval(AlwaysRowSelectedSelectionModel.java:92)
at com.servoy.j2db.util.model.AlwaysRowSelectedSelectionModel.intervalAdded(AlwaysRowSelectedSelectionModel.java:238)
at com.servoy.j2db.dataprocessing.TableAndListEventDelegate.fireIntervalAdded(TableAndListEventDelegate.java:120)
at com.servoy.j2db.dataprocessing.TableAndListEventDelegate$1.run(TableAndListEventDelegate.java:147)
at com.servoy.j2db.dataprocessing.TableAndListEventDelegate.fireTableAndListEvent(TableAndListEventDelegate.java:175)
at com.servoy.j2db.dataprocessing.SwingFoundSet.fireFoundSetEvent(SwingFoundSet.java:147)
at com.servoy.j2db.dataprocessing.FoundSet.addRecord(FoundSet.java:3693)
at com.servoy.j2db.dataprocessing.FoundSet.newRecord(FoundSet.java:3643)
at com.servoy.j2db.dataprocessing.FoundSet.newRecord(FoundSet.java:3606)
at com.servoy.j2db.FormController.newRecordImpl(FormController.java:2680)
at com.servoy.j2db.FormController.access$7(FormController.java:2664)
at com.servoy.j2db.FormController$JSForm.js_newRecord(FormController.java:1015)
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:179)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:361)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3134)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:179)
at org.mozilla.javascript.Context.evaluateString(Context.java:1233)
at com.servoy.j2db.scripting.ScriptEngine.eval(ScriptEngine.java:573)
at com.servoy.j2db.FormController.eval(FormController.java:3832)
at com.servoy.j2db.smart.dataui.DataTextEditor$LinkListener.hyperlinkUpdate(DataTextEditor.java:875)
at javax.swing.JEditorPane.fireHyperlinkUpdate(Unknown Source)
at com.servoy.j2db.util.gui.FixedHTMLEditorKit$LinkController.activateLink(FixedHTMLEditorKit.java:683)
at com.servoy.j2db.util.gui.FixedHTMLEditorKit$LinkController.mouseClicked(FixedHTMLEditorKit.java:488)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.AWTEventMulticaster.mouseClicked(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$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.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)
A while ago, there was an issue related to the foundset to having a current record selected after loading or modifying data. Looking at the error message, it appears that this issue is something similar. We are not seeing an error in the application so not sure what causes the error to show up in the server log. I suspect that in our code we are using something like:
var _record = foundset.getSelectedRecord();
if(_record)
{
...
}
The code will not “break” in this case since it checks if the foundset.getSelectedRecord() returns a result, but obviously the end result will not be correct. In my opinion, if a foundset contains any records, it should always have at least 1 record selected.