Page 1 of 1

Weird Servoy Smart Client Errors on Upgrade from 7 -> Latest

PostPosted: Sat Jun 10, 2023 11:39 pm
by d.pearce1417196993
Hi, I wonder whether anyone can help. I am upgrading an old solution that is getting more precarious on Servoy 7.

I get everything into Eclipse OK, and updated some plugins etc to get me past our login screen.

On running smart client from Developer.

In the main on solution open, I am getting weird errors that appear to be Java and not from any one line of script. It first triggers literally on setting a variable based on developer/live to a fixed URL. But then if I comment that out, the same just happens.

The error is nothing to do with the actual line of code that is being run.

I have checked all the code anyway and all of the .setHours scripts have the full 0,0,0,0) so no errors their.

Java is 1.8 latest release. I have also update svyUtils.

Any clues to what this is??

Thanks as always in advance. I never believe it would be as easy! Its a smart client app only.


The line it first triggers from is:

Code: Select all
scopes.cloudClinics_common.nephexMROAPIServer = (application.isInDeveloper() ? 'domainDev:8080' : 'domainLive');

but if I comment that out the error just happens at a later stage.

Code: Select all
ERROR com.servoy.j2db.util.Debug - For input string: "new Date().setHours(0" java.lang.NumberFormatException: For input string: "new Date().setHours(0"
   at java.lang.NumberFormatException.forInputString(Unknown Source) ~[?:?]
   at java.lang.Long.parseLong(Unknown Source) ~[?:?]
   at java.lang.Long.valueOf(Unknown Source) ~[?:?]
   at com.servoy.j2db.persistence.ScriptVariable.parseDate( ~[?:?]
   at com.servoy.j2db.persistence.ScriptVariable.getInitValue( ~[?:?]
   at com.servoy.j2db.scripting.ScriptVariableScope.putScriptVariable( ~[?:?]
   at com.servoy.j2db.scripting.ScopesScope$1.putScriptVariable( ~[?:?]
   at com.servoy.j2db.scripting.GlobalScope.put( ~[?:?]
   at com.servoy.j2db.scripting.ScriptVariableScope.put( ~[?:?]
   at com.servoy.j2db.scripting.GlobalScope.createVars( ~[?:?]
   at com.servoy.j2db.scripting.ScopesScope.getGlobalScope( ~[?:?]
   at com.servoy.j2db.scripting.ScopesScope.get( ~[?:?]
   at org.mozilla.javascript.ScriptableObject.getProperty( ~[?:?]
   at org.mozilla.javascript.ScriptRuntime.getObjectProp( ~[?:?]
   at org.mozilla.javascript.ScriptRuntime.getObjectProp( ~[?:?]
   at org.mozilla.javascript.Interpreter.interpretLoop( ~[?:?]
   at org.mozilla.javascript.Interpreter.interpret( ~[?:?]
   at ~[?:?]
   at org.mozilla.javascript.ContextFactory.doTopCall( ~[?:?]
   at org.mozilla.javascript.ScriptRuntime.doTopCall( ~[?:?]
   at ~[?:?]
   at com.servoy.j2db.scripting.ScriptEngine.executeFunction( ~[?:?]
   at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction( ~[?:?]
   at com.servoy.j2db.scripting.ScopesScope.executeGlobalFunction( ~[?:?]
   at com.servoy.j2db.FormManager.makeSolutionSettings( ~[?:?]
   at ~[?:?]
   at com.servoy.j2db.debug.DebugJ2DBClient$DebugSwingFormMananger.makeSolutionSettings( ~[?:?]
   at com.servoy.j2db.FormManager$ ~[?:?]
   at java.awt.event.InvocationEvent.dispatch(Unknown Source) ~[?:?]
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source) ~[?:?]
   at java.awt.EventQueue$ Source) ~[?:?]
   at java.awt.EventQueue$ Source) ~[?:?]
   at Source) ~[?:?]
   at$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 Source) ~[?:?]</code>

Re: Weird Servoy Smart Client Errors on Upgrade from 7 -> La

PostPosted: Sun Jun 11, 2023 11:22 am
by swingman
No idea, but I would start by changing

Code: Select all
new Date().setHours(


Code: Select all
(new Date()).setHours(

to clarify to the interpreter what you are trying to do...

Re: Weird Servoy Smart Client Errors on Upgrade from 7 -> La

PostPosted: Sun Jun 11, 2023 1:27 pm
by d.pearce1417196993
Thanks Christian!
A lot of them to change, but that figures, and works!!!

Re: Weird Servoy Smart Client Errors on Upgrade from 7 -> La

PostPosted: Mon Jun 12, 2023 10:24 am
by mboegem
Hi David,

As you are using svyUtils module and need to change these lines of code anyway.
Why not fix it like this:
Code: Select all
new scopes.svyDateUtils.DateTime().toStartOfDay().date