what is causing java.lang.NullPointerException?

Hi,

I get the error in the Debug Console of Servoy Developer:

Exception Object: java.lang.NullPointerException
MSG:
null

java.lang.NullPointerException

if I close the debug client of the Servoy Developer when a form with related tabpanels is displayed, but I don’t know where it comes from or what exactly is causing the NullPointerException?

Servoy version 5.2.9 -build 1020
ava.vm.name=Java HotSpot™ 64-Bit Server VM
java.version=1.6.0_26
os.name=Mac OS X
os.version=10.6.8

This is the log entry:

2011-07-05 11:13:28,854 ERROR [AWT-EventQueue-0] com.servoy.j2db.util.Debug - Throwable
java.lang.NullPointerException
at com.servoy.j2db.scripting.SelectedRecordScope.getSelectedRecord(SelectedRecordScope.java:44)
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:1740)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1679)
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 org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3135)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:476)
at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:382)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3977)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3865)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3787)
at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3642)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:272)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:242)
at com.servoy.j2db.ui.BaseEventExecutor.fireLeaveCommands(BaseEventExecutor.java:197)
at com.servoy.j2db.smart.dataui.DataField$1.fireLeaveCommands(DataField.java:703)
at com.servoy.j2db.smart.dataui.DataField.stopUIEditing(DataField.java:2254)
at com.servoy.j2db.dataprocessing.DataAdapterList.stopUIEditing(DataAdapterList.java:580)
at com.servoy.j2db.dataprocessing.DataAdapterList.setRecord(DataAdapterList.java:357)
at com.servoy.j2db.dataprocessing.DataAdapterList.destroy(DataAdapterList.java:693)
at com.servoy.j2db.smart.dataui.DataRenderer.destroy(DataRenderer.java:223)
at com.servoy.j2db.FormController.deleteRenderers(FormController.java:1873)
at com.servoy.j2db.FormController.destroy(FormController.java:1833)
at com.servoy.j2db.FormManager.removeAllFormPanels(FormManager.java:860)
at com.servoy.j2db.smart.SwingFormManager.removeAllFormPanels(SwingFormManager.java:205)
at com.servoy.j2db.FormManager.destroySolutionSettings(FormManager.java:432)
at com.servoy.j2db.smart.SwingFormManager.destroySolutionSettings(SwingFormManager.java:404)
at com.servoy.j2db.debug.DebugJ2DBClient$DebugSwingFormMananger.destroySolutionSettings(DebugJ2DBClient.java:211)
at com.servoy.j2db.FormManager.propertyChange(FormManager.java:155)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:75)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
at com.servoy.j2db.J2DBGlobals.firePropertyChange(J2DBGlobals.java:90)
at com.servoy.j2db.ClientState.closeSolution(ClientState.java:1140)
at com.servoy.j2db.smart.J2DBClient.closeSolution(J2DBClient.java:1969)
at com.servoy.j2db.debug.DebugJ2DBClient.closeSolution(DebugJ2DBClient.java:722)
at com.servoy.j2db.debug.DebugJ2DBClient.shutDown(DebugJ2DBClient.java:681)
at com.servoy.j2db.smart.J2DBClient$13.windowClosing(J2DBClient.java:1056)
at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:332)
at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:332)
at java.awt.Window.processWindowEvent(Window.java:1865)
at javax.swing.JFrame.processWindowEvent(JFrame.java:274)
at java.awt.Window.processEvent(Window.java:1823)
at java.awt.Component.dispatchEventImpl(Component.java:4735)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:679)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:652)
at java.awt.EventQueue$2.run(EventQueue.java:650)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

How can I fix this problem?

Thomas,

From the stack it looks like you get this when you have focus on a field with an onfocuslost event attached and the dataprovider is a form variable.
When closing the main window frame you get this error, right?

If suspect there is another exception happening when the error occurs which is only logged when tracing is enabled.

If you can reproduce this, please turn on tracing in the servoy.properties and check if another exception happens.

Rob

Hi Rob,

I have only one field in a related tabpanel with an onfocuslost/onfocusgained event, but it is no focus on it and also not a form variable.
I have set the events of the field (dataprovider) to -none- and turned tracing in servoy-admin on.

When now closing the main window I still get an error and the server log shows again only this one error message:

011-07-05 13:36 AWT-EventQueue-0 ERROR com.servoy.j2db.util.Debug Throwable
java.lang.NullPointerException
at com.servoy.j2db.scripting.SelectedRecordScope.getSelectedRecord(SelectedRecordScope.java:44)
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:1740)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1679)
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 org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3135)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:476)
at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:382)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3977)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3865)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3787)
at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3642)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:272)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:242)
at com.servoy.j2db.ui.BaseEventExecutor.fireLeaveCommands(BaseEventExecutor.java:197)
at com.servoy.j2db.smart.dataui.DataField$1.fireLeaveCommands(DataField.java:703)
at com.servoy.j2db.smart.dataui.DataField.stopUIEditing(DataField.java:2254)
at com.servoy.j2db.dataprocessing.DataAdapterList.stopUIEditing(DataAdapterList.java:580)
at com.servoy.j2db.dataprocessing.DataAdapterList.setRecord(DataAdapterList.java:357)
at com.servoy.j2db.dataprocessing.DataAdapterList.destroy(DataAdapterList.java:693)
at com.servoy.j2db.smart.dataui.DataRenderer.destroy(DataRenderer.java:223)
at com.servoy.j2db.FormController.deleteRenderers(FormController.java:1873)
at com.servoy.j2db.FormController.destroy(FormController.java:1833)
at com.servoy.j2db.FormManager.removeAllFormPanels(FormManager.java:860)
at com.servoy.j2db.smart.SwingFormManager.removeAllFormPanels(SwingFormManager.java:205)
at com.servoy.j2db.FormManager.destroySolutionSettings(FormManager.java:432)
at com.servoy.j2db.smart.SwingFormManager.destroySolutionSettings(SwingFormManager.java:404)
at com.servoy.j2db.debug.DebugJ2DBClient$DebugSwingFormMananger.destroySolutionSettings(DebugJ2DBClient.java:211)
at com.servoy.j2db.FormManager.propertyChange(FormManager.java:155)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:75)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
at com.servoy.j2db.J2DBGlobals.firePropertyChange(J2DBGlobals.java:90)
at com.servoy.j2db.ClientState.closeSolution(ClientState.java:1140)
at com.servoy.j2db.smart.J2DBClient.closeSolution(J2DBClient.java:1969)
at com.servoy.j2db.debug.DebugJ2DBClient.closeSolution(DebugJ2DBClient.java:722)
at com.servoy.j2db.debug.DebugJ2DBClient.shutDown(DebugJ2DBClient.java:681)
at com.servoy.j2db.smart.J2DBClient$13.windowClosing(J2DBClient.java:1056)
at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:332)
at java.awt.Window.processWindowEvent(Window.java:1865)
at javax.swing.JFrame.processWindowEvent(JFrame.java:274)
at java.awt.Window.processEvent(Window.java:1823)
at java.awt.Component.dispatchEventImpl(Component.java:4735)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:679)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:652)
at java.awt.EventQueue$2.run(EventQueue.java:650)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Thomas,

I cannot reproduce it from your description.
Please try to show this in a small sample solution and file a case in our support system.

Rob

if you do a application.output(“my on leave”, LOGGINGLEVEL.ERROR) as the first command in your onleave method
do you see that just before the null pointer exception?

if you don’t see that then it is possible that it is another form maybe even not visible anymore that does that.

EDIT: this is not going to work, because the resolving for “application” will cause the same thing :(

Thank you Rob and Johan!

I think I could fix that issue. In reality I had an other problem and the NullPointerException error was the consequence of this.
The onShow event of a deep related form was triggered with bad code. A value would be set by function to a dataprovider without records in the foundset :oops: !

Thought wrong! I have still the NullPointerException ERROR if I close the solution (debug smart client) when the ‘customer’ form is in front.
I have checked all the elements on the form, also the functions and calculations. Went through the debugger at onLoad, onShow and onSolutionClose. Cannot find any bug or error but get now two NullPointerException errors while closing the smart client!?
It would be helpful if I could detect what is causing this error, but the error message is too inexact and it can be everything…
Perhaps this tracelog gives you an answer:

2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug location of Application_frame java.awt.Point[x=10,y=22]
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug WindowPlugin: solution closed
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug questiondata[1] = 801 ,type: java.lang.Integer
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug questiondata[0] = ‘’ ,type: java.lang.String
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug used sql select distinct country from bc_customer where country = ? order by country asc limit ? questiondata.length 2
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug QuerySet { updates = , select = select distinct country from bc_customer where country = ? order by country asc limit ? [[,801]] <0^801>, cleanups = }
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug SELECT DISTINCT public:bc_customer#bccustomer1366.1073742926=country<12,20,0> FROM public:bc_customer#bccustomer1366 SEARCH (((public:bc_customer#bccustomer1366.1073742926=country<12,20,0>)=())) ORDER BY public:bc_customer#bccustomer1366.1073742926=country<12,20,0> ASC FILTER null
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug Analysing filters null
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug sql select SELECT DISTINCT public:bc_customer#bccustomer1366.1073742926=country<12,20,0> FROM public:bc_customer#bccustomer1366 SEARCH (((public:bc_customer#bccustomer1366.1073742926=country<12,20,0>)=())) ORDER BY public:bc_customer#bccustomer1366.1073742926=country<12,20,0> ASC
2011-07-06 09:47 AWT-EventQueue-0 ERROR com.servoy.j2db.util.Debug Throwable
java.lang.NullPointerException
at com.servoy.j2db.scripting.SelectedRecordScope.getSelectedRecord(SelectedRecordScope.java:44)
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:1740)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1679)
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 org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3135)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:476)
at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:382)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3977)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3865)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3787)
at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3642)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:272)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:242)
at com.servoy.j2db.ui.BaseEventExecutor.fireLeaveCommands(BaseEventExecutor.java:197)
at com.servoy.j2db.smart.dataui.DataField$1.fireLeaveCommands(DataField.java:703)
at com.servoy.j2db.smart.dataui.DataField.stopUIEditing(DataField.java:2254)
at com.servoy.j2db.dataprocessing.DataAdapterList.stopUIEditing(DataAdapterList.java:580)
at com.servoy.j2db.dataprocessing.DataAdapterList.setRecord(DataAdapterList.java:357)
at com.servoy.j2db.dataprocessing.DataAdapterList.destroy(DataAdapterList.java:693)
at com.servoy.j2db.smart.dataui.DataRenderer.destroy(DataRenderer.java:223)
at com.servoy.j2db.FormController.deleteRenderers(FormController.java:1873)
at com.servoy.j2db.FormController.destroy(FormController.java:1833)
at com.servoy.j2db.FormManager.removeAllFormPanels(FormManager.java:860)
at com.servoy.j2db.smart.SwingFormManager.removeAllFormPanels(SwingFormManager.java:205)
at com.servoy.j2db.FormManager.destroySolutionSettings(FormManager.java:432)
at com.servoy.j2db.smart.SwingFormManager.destroySolutionSettings(SwingFormManager.java:404)
at com.servoy.j2db.debug.DebugJ2DBClient$DebugSwingFormMananger.destroySolutionSettings(DebugJ2DBClient.java:211)
at com.servoy.j2db.FormManager.propertyChange(FormManager.java:155)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:75)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
at com.servoy.j2db.J2DBGlobals.firePropertyChange(J2DBGlobals.java:90)
at com.servoy.j2db.ClientState.closeSolution(ClientState.java:1140)
at com.servoy.j2db.smart.J2DBClient.closeSolution(J2DBClient.java:1969)
at com.servoy.j2db.debug.DebugJ2DBClient.closeSolution(DebugJ2DBClient.java:722)
at com.servoy.j2db.debug.DebugJ2DBClient.shutDown(DebugJ2DBClient.java:681)
at com.servoy.j2db.smart.J2DBClient$13.windowClosing(J2DBClient.java:1056)
at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:332)
at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:332)
at java.awt.Window.processWindowEvent(Window.java:1865)
at javax.swing.JFrame.processWindowEvent(JFrame.java:274)
at java.awt.Window.processEvent(Window.java:1823)
at java.awt.Component.dispatchEventImpl(Component.java:4735)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:679)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:652)
at java.awt.EventQueue$2.run(EventQueue.java:650)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
2011-07-06 09:47 AWT-EventQueue-0 ERROR com.servoy.j2db.util.Debug Throwable
java.lang.NullPointerException
at com.servoy.j2db.scripting.SelectedRecordScope.getSelectedRecord(SelectedRecordScope.java:44)
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:1740)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1679)
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 org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3135)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:476)
at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:382)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3977)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3865)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3787)
at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3642)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:272)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:242)
at com.servoy.j2db.ui.BaseEventExecutor.fireLeaveCommands(BaseEventExecutor.java:197)
at com.servoy.j2db.smart.dataui.DataField$1.fireLeaveCommands(DataField.java:703)
at com.servoy.j2db.smart.dataui.DataField.stopUIEditing(DataField.java:2254)
at com.servoy.j2db.dataprocessing.DataAdapterList.stopUIEditing(DataAdapterList.java:580)
at com.servoy.j2db.dataprocessing.DataAdapterList.setRecord(DataAdapterList.java:357)
at com.servoy.j2db.dataprocessing.DataAdapterList.destroy(DataAdapterList.java:693)
at com.servoy.j2db.smart.dataui.DataRenderer.destroy(DataRenderer.java:223)
at com.servoy.j2db.FormController.deleteRenderers(FormController.java:1873)
at com.servoy.j2db.FormController.destroy(FormController.java:1833)
at com.servoy.j2db.FormManager.removeAllFormPanels(FormManager.java:860)
at com.servoy.j2db.smart.SwingFormManager.removeAllFormPanels(SwingFormManager.java:205)
at com.servoy.j2db.FormManager.destroySolutionSettings(FormManager.java:432)
at com.servoy.j2db.smart.SwingFormManager.destroySolutionSettings(SwingFormManager.java:404)
at com.servoy.j2db.debug.DebugJ2DBClient$DebugSwingFormMananger.destroySolutionSettings(DebugJ2DBClient.java:211)
at com.servoy.j2db.FormManager.propertyChange(FormManager.java:155)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:75)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
at com.servoy.j2db.J2DBGlobals.firePropertyChange(J2DBGlobals.java:90)
at com.servoy.j2db.ClientState.closeSolution(ClientState.java:1140)
at com.servoy.j2db.smart.J2DBClient.closeSolution(J2DBClient.java:1969)
at com.servoy.j2db.debug.DebugJ2DBClient.closeSolution(DebugJ2DBClient.java:722)
at com.servoy.j2db.debug.DebugJ2DBClient.shutDown(DebugJ2DBClient.java:681)
at com.servoy.j2db.smart.J2DBClient$13.windowClosing(J2DBClient.java:1056)
at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:332)
at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:332)
at java.awt.Window.processWindowEvent(Window.java:1865)
at javax.swing.JFrame.processWindowEvent(JFrame.java:274)
at java.awt.Window.processEvent(Window.java:1823)
at java.awt.Component.dispatchEventImpl(Component.java:4735)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:679)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:652)
at java.awt.EventQueue$2.run(EventQueue.java:650)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug FormPanel ‘frm_logout’ created, Loaded forms: 28 of 128 (max).
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug -->DisplaysAdapter null with 1 displays, hash 1669911196
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug CreationalPrototype:get frm_logout scope com.servoy.j2db.scripting.CreationalPrototype@5dd9cdc1
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug Find executed, time: 1 thread: AWT-EventQueue-0, sql: SELECT public:bc_user#bcuser1270.1073742960=id_user<4,0,0> FROM public:bc_user#bcuser1270 SEARCH (((public:bc_user#bcuser1270.1073742985=user_name<12,50,0>)=([admin]))) ORDER BY public:bc_user#bcuser1270.1073742960=id_user<4,0,0> ASC
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug questiondata[1] = 201 ,type: java.lang.Integer
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug questiondata[0] = ‘admin’ ,type: java.lang.String
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug used sql select id_user from bc_user where user_name = ? order by id_user asc limit ? questiondata.length 2
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug QuerySet { updates = , select = select id_user from bc_user where user_name = ? order by id_user asc limit ? [[admin,201]] <0^201>, cleanups = }
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug SELECT public:bc_user#bcuser1270.1073742960=id_user<4,0,0> FROM public:bc_user#bcuser1270 SEARCH (((public:bc_user#bcuser1270.1073742985=user_name<12,50,0>)=([admin]))) ORDER BY public:bc_user#bcuser1270.1073742960=id_user<4,0,0> ASC FILTER null
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug Analysing filters null
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug sql select SELECT public:bc_user#bcuser1270.1073742960=id_user<4,0,0> FROM public:bc_user#bcuser1270 SEARCH (((public:bc_user#bcuser1270.1073742985=user_name<12,50,0>)=([admin]))) ORDER BY public:bc_user#bcuser1270.1073742960=id_user<4,0,0> ASC
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug Search called for form ‘frm_user’
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug Find started for tab form: frm_user
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug AWT-EventQueue-0: RefreshFrom DB time: 1 pks: 4, SQL: SELECT public:bc_user#bcuser1270.1073742960=id_user<4,0,0> FROM public:bc_user#bcuser1270 ORDER BY public:bc_user#bcuser1270.1073742960=id_user<4,0,0> ASC
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug questiondata[0] = 201 ,type: java.lang.Integer
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug used sql select id_user from bc_user order by id_user asc limit ? questiondata.length 1
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug QuerySet { updates = , select = select id_user from bc_user order by id_user asc limit ? [[201]] <0^201>, cleanups = }
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug SELECT public:bc_user#bcuser1270.1073742960=id_user<4,0,0> FROM public:bc_user#bcuser1270 ORDER BY public:bc_user#bcuser1270.1073742960=id_user<4,0,0> ASC FILTER null
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug Analysing filters null
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug sql select SELECT public:bc_user#bcuser1270.1073742960=id_user<4,0,0> FROM public:bc_user#bcuser1270 ORDER BY public:bc_user#bcuser1270.1073742960=id_user<4,0,0> ASC
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug WindowPlugin: currentWindow changed to null
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug WindowPlugin: currentWindow changed to dlg_basic
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug FormPanel ‘dlg_basic’ created, Loaded forms: 27 of 128 (max).
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug -->DisplaysAdapter fv_icon_med with 1 displays, hash 266929864
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug -->DisplaysAdapter fv_text_txt with 1 displays, hash 1064621924
2011-07-06 09:47 AWT-EventQueue-0 INFO com.servoy.j2db.util.Debug CreationalPrototype:get dlg_basic scope com.servoy.j2db.scripting.CreationalPrototype@5dd9cdc1

its an onfocuslost of a textfield that is triggering this, it shouldn’t do that but somehow you have a situation that it things that field is in edit mode.

Ok, I have eleminated the onFocusLost event of two text fields on related forms in tabpanels… and the error is gone… so far.
It’s good to know what the problem was and I will try now to make an other solution for this function. But I have a lot of onFocusLost events in my solutions and had never the NullPointerException error before!? And if I close the smart client the elements are readOnly = true without focus on it. BTW, how can be a focus on two fields at the same time?

that is somehow a bug, if you could reproduce this in a sample please make a case, We shouldn’t fire onleave for those textfields on that time.

I have created a sample solution, but I could not reproduce the NullPointerException error.
Perhaps I have to play a little bit more with it. If I get the error in the sample I will file a support case.

this specific problem shouldn’t happen anymore in 6.0.1. We made it a bit safer there so that no method are executed anymore at that time (when the solution is closing)

I’ve run into this problem with 5.2.9 also. It occurs whenever onElementFocusLost is set to something other than DEFAULT on any form that is using the servoyCommons framework. Apparently, Java is trying to fire the onElementFocusLost method after the form has been unloaded. Setting this method back to default eliminates the error. This was not an issue prior to 5.2.9. I have also been working with Servoy tech support on an issue that only occurs with the smart client (web client works fine) on a live server (debug smart client works fine) where there is a 45 second delay when the onLoad even fires the first time. This problem only occurs when a form is using the servoyCommons framework and only on the smart client.I suspect this issue may be some sort of a silent Java error (no errors on the application server or the Java console. So far there has been no progress on this issue - if anyone has any insight, it would be appreciated.

A bug release for 5.2.X would be appreciated for everyone that is not quite ready to migrate to 6.x as there is no work around for the null pointer bug other than not using the on elementFocusLost method on any form.

Chuck.Amata:
I’ve run into this problem with 5.2.9 also. It occurs whenever onElementFocusLost is set to something other than DEFAULT on any form that is using the servoyCommons framework. Apparently, Java is trying to fire the onElementFocusLost method after the form has been unloaded. Setting this method back to default eliminates the error. This was not an issue prior to 5.2.9. I have also been working with Servoy tech support on an issue that only occurs with the smart client (web client works fine) on a live server (debug smart client works fine) where there is a 45 second delay when the onLoad even fires the first time. This problem only occurs when a form is using the servoyCommons framework and only on the smart client.I suspect this issue may be some sort of a silent Java error (no errors on the application server or the Java console. So far there has been no progress on this issue - if anyone has any insight, it would be appreciated.

A bug release for 5.2.X would be appreciated for everyone that is not quite ready to migrate to 6.x as there is no work around for the null pointer bug other than not using the on elementFocusLost method on any form.

As Johan said, the issue is fixed for Servoy 6.0.1 . We cannot backport the fix to Servoy 5.2.x because it is rather large. Also, there is no behavior broken, just some unwanted error is logged.