Error when display Time value in field

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Error when display Time value in field

Postby derk.hulshof » Tue Jan 28, 2020 10:17 am

Hi all,

I am using version 2019.09 (2019.12.x same issue with dispaly value)

The value in the database is DateTIme and displayed in a Calendar field with format 'HH:mm'
No it displays 01:00 in the field while the value in the database is 09:30:00

Looks like a bug to me, or is there something different with the display in the Calendar fields?
Is there a workaround?

ERROR :

ERROR org.sablo.websocket.utils.JSONUtils - Error while converting value: 09:30:00 of key: null to type: com.servoy.j2db.server.ngclient.property.types.NGDatePropertyType@f9e72dca current json: null java.lang.UnsupportedOperationException: null
at java.sql.Time.toInstant(Unknown Source) ~[java.sql:?]
at com.servoy.j2db.server.ngclient.property.types.NGDatePropertyType.toJSON(NGDatePropertyType.java:106) ~[?:?]
at org.sablo.specification.property.types.DatePropertyType.toJSON(DatePropertyType.java:1) ~[sablo_2019.9.0.3522.jar:?]
at org.sablo.websocket.utils.JSONUtils$FullValueToJSONConverter.toJSONValue(JSONUtils.java:457) [sablo_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.property.types.DataproviderTypeSabloValue.getValueForToJSON(DataproviderTypeSabloValue.java:670) [servoy_ngclient_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.property.types.DataproviderTypeSabloValue.toJSON(DataproviderTypeSabloValue.java:586) [servoy_ngclient_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.property.types.DataproviderPropertyType.toJSON(DataproviderPropertyType.java:149) [servoy_ngclient_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.property.types.DataproviderPropertyType.toJSON(DataproviderPropertyType.java:1) [servoy_ngclient_2019.9.0.3522.jar:?]
at org.sablo.websocket.utils.JSONUtils$FullValueToJSONConverter.toJSONValue(JSONUtils.java:457) [sablo_2019.9.0.3522.jar:?]
at org.sablo.websocket.utils.JSONUtils$ChangesToJSONConverter.toJSONValue(JSONUtils.java:532) [sablo_2019.9.0.3522.jar:?]
at org.sablo.websocket.utils.JSONUtils$FullValueToJSONConverter.toJSONValue(JSONUtils.java:1) [sablo_2019.9.0.3522.jar:?]
at org.sablo.BaseWebObject.writeProperties(BaseWebObject.java:1123) [sablo_2019.9.0.3522.jar:?]
at org.sablo.BaseWebObject.writeOwnChanges(BaseWebObject.java:1087) [sablo_2019.9.0.3522.jar:?]
at org.sablo.Container.writeAllComponentsChanges(Container.java:117) [sablo_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.WebFormUI.writeAllComponentsChanges(WebFormUI.java:402) [servoy_ngclient_2019.9.0.3522.jar:?]
at org.sablo.websocket.BaseWindow.writeAllComponentsChanges(BaseWindow.java:941) [sablo_2019.9.0.3522.jar:?]
at org.sablo.websocket.BaseWindow$4.writeJSONContent(BaseWindow.java:737) [sablo_2019.9.0.3522.jar:?]
at org.sablo.websocket.BaseWindow.sendMessageInternal(BaseWindow.java:532) [sablo_2019.9.0.3522.jar:?]
at org.sablo.websocket.BaseWindow.sendAsyncMessage(BaseWindow.java:506) [sablo_2019.9.0.3522.jar:?]
at org.sablo.websocket.BaseWindow.sendChanges(BaseWindow.java:727) [sablo_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.NGClientWindow.sendChanges(NGClientWindow.java:114) [servoy_ngclient_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.NGRuntimeWindow.doOldShow(NGRuntimeWindow.java:489) [servoy_ngclient_2019.9.0.3522.jar:?]
at com.servoy.j2db.scripting.RuntimeWindow.doShow(RuntimeWindow.java:304) [servoy_shared_2019.9.0.3522.jar:?]
at com.servoy.j2db.scripting.RuntimeWindow.show(RuntimeWindow.java:298) [servoy_shared_2019.9.0.3522.jar:?]
at com.servoy.j2db.scripting.RuntimeWindow.showObject(RuntimeWindow.java:285) [servoy_shared_2019.9.0.3522.jar:?]
at com.servoy.j2db.scripting.JSWindow.js_show(JSWindow.java:155) [servoy_shared_2019.9.0.3522.jar:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138) [org.eclipse.dltk.javascript.rhino_2019.9.0.3522.jar:?]
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:292) [org.eclipse.dltk.javascript.rhino_2019.9.0.3522.jar:?]
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1487) [org.eclipse.dltk.javascript.rhino_2019.9.0.3522.jar:?]
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815) [org.eclipse.dltk.javascript.rhino_2019.9.0.3522.jar:?]
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109) [org.eclipse.dltk.javascript.rhino_2019.9.0.3522.jar:?]
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:399) [org.eclipse.dltk.javascript.rhino_2019.9.0.3522.jar:?]
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3534) [org.eclipse.dltk.javascript.rhino_2019.9.0.3522.jar:?]
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107) [org.eclipse.dltk.javascript.rhino_2019.9.0.3522.jar:?]
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:665) [servoy_shared_2019.9.0.3522.jar:?]
at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:393) [servoy_debug_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.component.EventExecutor.executeEvent(EventExecutor.java:234) [servoy_ngclient_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.DataAdapterList.executeEvent(DataAdapterList.java:126) [servoy_ngclient_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.WebFormComponent$FormcomponentEventHandler.executeEvent(WebFormComponent.java:240) [servoy_ngclient_2019.9.0.3522.jar:?]
at org.sablo.BaseWebObject.doExecuteEvent(BaseWebObject.java:335) [sablo_2019.9.0.3522.jar:?]
at org.sablo.BaseWebObject.executeEvent(BaseWebObject.java:324) [sablo_2019.9.0.3522.jar:?]
at org.sablo.services.server.FormServiceHandler.executeEvent(FormServiceHandler.java:137) [sablo_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.NGFormServiceHandler.executeEvent(NGFormServiceHandler.java:503) [servoy_ngclient_2019.9.0.3522.jar:?]
at org.sablo.services.server.FormServiceHandler.executeMethod(FormServiceHandler.java:84) [sablo_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.NGFormServiceHandler.executeMethod(NGFormServiceHandler.java:482) [servoy_ngclient_2019.9.0.3522.jar:?]
at org.sablo.websocket.WebsocketEndpoint$5.run(WebsocketEndpoint.java:408) [sablo_2019.9.0.3522.jar:?]
at org.sablo.eventthread.Event$1.run(Event.java:102) [sablo_2019.9.0.3522.jar:?]
at org.sablo.websocket.CurrentWindow.runForWindow(CurrentWindow.java:76) [sablo_2019.9.0.3522.jar:?]
at org.sablo.eventthread.Event.execute(Event.java:92) [sablo_2019.9.0.3522.jar:?]
at org.sablo.eventthread.EventDispatcher.dispatch(EventDispatcher.java:125) [sablo_2019.9.0.3522.jar:?]
at org.sablo.eventthread.EventDispatcher.run(EventDispatcher.java:89) [sablo_2019.9.0.3522.jar:?]
at com.servoy.j2db.server.ngclient.eventthread.NGEventDispatcher.run(NGEventDispatcher.java:55) [servoy_ngclient_2019.9.0.3522.jar:?]
at java.lang.Thread.run(Unknown Source) [?:?]
ERROR com.servoy.j2db.util.Debug - A dataprovider that is not able to send itself to client... (PropertyDescription[name: Dataprovider (date), type: com.servoy.j2db.server.ngclient.property.types.NGDatePropertyType@f9e72dca, config: null, default value: null], 09:30:00)
derk.hulshof
 
Posts: 103
Joined: Tue Dec 03, 2013 9:18 am
Location: Netherlands

Re: Error when display Time value in field

Postby Andrei Costescu » Mon Mar 02, 2020 5:15 pm

Are you sure it reproduces in 2019.12?
I see a fix for this sort of errors in October (so after 2019.09).

Can you put here the stack trace that you get using 2019.12? (it might be something else)
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 976
Joined: Tue Jun 26, 2007 3:14 pm

Re: Error when display Time value in field

Postby derk.hulshof » Mon Mar 09, 2020 4:55 pm

Hi Andrei,

Thanks for you reply. I just updated my Servoy developer to 2019.12.1

and still receiving an error. Please let know how to fix this.



------------------------------------------- ERROR -----------------------------------

020-03-09 15:52 Executor,uuid:DA479A0:2 ERROR com.servoy.j2db.util.Debug A dataprovider that is not able to send itself to client... (PropertyDescription[name: Dataprovider (date), type:
2020-03-09 15:52 Executor,uuid:DA479A0:2 ERROR org.sablo.websocket.utils.JSONUtils Error while converting value: 19:30:00 of key: null to type: com.servoy.j2db.server.ngclient.property.types.NGDatePropertyType@febf497 current json: null
java.lang.UnsupportedOperationException: null
at java.sql.Time.toInstant(Unknown Source) ~[java.sql:?]
at com.servoy.j2db.server.ngclient.property.types.NGDatePropertyType.toJSON(NGDatePropertyType.java:105) ~[?:?]
at org.sablo.specification.property.types.DatePropertyType.toJSON(DatePropertyType.java:1) ~[sablo_2019.12.1.3543.jar:?]
at org.sablo.websocket.utils.JSONUtils$FullValueToJSONConverter.toJSONValue(JSONUtils.java:457) [sablo_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.property.types.DataproviderTypeSabloValue.getValueForToJSON(DataproviderTypeSabloValue.java:673) [servoy_ngclient_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.property.types.DataproviderTypeSabloValue.toJSON(DataproviderTypeSabloValue.java:589) [servoy_ngclient_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.property.types.DataproviderPropertyType.toJSON(DataproviderPropertyType.java:149) [servoy_ngclient_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.property.types.DataproviderPropertyType.toJSON(DataproviderPropertyType.java:1) [servoy_ngclient_2019.12.1.3543.jar:?]
at org.sablo.websocket.utils.JSONUtils$FullValueToJSONConverter.toJSONValue(JSONUtils.java:457) [sablo_2019.12.1.3543.jar:?]
at org.sablo.websocket.utils.JSONUtils$ChangesToJSONConverter.toJSONValue(JSONUtils.java:532) [sablo_2019.12.1.3543.jar:?]
at org.sablo.websocket.utils.JSONUtils$FullValueToJSONConverter.toJSONValue(JSONUtils.java:1) [sablo_2019.12.1.3543.jar:?]
at org.sablo.BaseWebObject.writeProperties(BaseWebObject.java:1123) [sablo_2019.12.1.3543.jar:?]
at org.sablo.BaseWebObject.writeOwnChanges(BaseWebObject.java:1087) [sablo_2019.12.1.3543.jar:?]
at org.sablo.Container.writeAllComponentsChanges(Container.java:117) [sablo_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.WebFormUI.writeAllComponentsChanges(WebFormUI.java:481) [servoy_ngclient_2019.12.1.3543.jar:?]
at org.sablo.websocket.BaseWindow.writeAllComponentsChanges(BaseWindow.java:941) [sablo_2019.12.1.3543.jar:?]
at org.sablo.websocket.BaseWindow$4.writeJSONContent(BaseWindow.java:737) [sablo_2019.12.1.3543.jar:?]
at org.sablo.websocket.BaseWindow.sendMessageInternal(BaseWindow.java:532) [sablo_2019.12.1.3543.jar:?]
at org.sablo.websocket.BaseWindow.sendAsyncMessage(BaseWindow.java:506) [sablo_2019.12.1.3543.jar:?]
at org.sablo.websocket.BaseWindow.sendChanges(BaseWindow.java:727) [sablo_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.NGClientWindow.sendChanges(NGClientWindow.java:114) [servoy_ngclient_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.NGRuntimeWindow.doOldShow(NGRuntimeWindow.java:489) [servoy_ngclient_2019.12.1.3543.jar:?]
at com.servoy.j2db.scripting.RuntimeWindow.doShow(RuntimeWindow.java:304) [servoy_shared_2019.12.1.3543.jar:?]
at com.servoy.j2db.scripting.RuntimeWindow.show(RuntimeWindow.java:298) [servoy_shared_2019.12.1.3543.jar:?]
at com.servoy.j2db.scripting.RuntimeWindow.showObject(RuntimeWindow.java:285) [servoy_shared_2019.12.1.3543.jar:?]
at com.servoy.j2db.scripting.JSWindow.js_show(JSWindow.java:155) [servoy_shared_2019.12.1.3543.jar:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138) [org.eclipse.dltk.javascript.rhino_2019.12.1.3543.jar:?]
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:292) [org.eclipse.dltk.javascript.rhino_2019.12.1.3543.jar:?]
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1487) [org.eclipse.dltk.javascript.rhino_2019.12.1.3543.jar:?]
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815) [org.eclipse.dltk.javascript.rhino_2019.12.1.3543.jar:?]
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109) [org.eclipse.dltk.javascript.rhino_2019.12.1.3543.jar:?]
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:399) [org.eclipse.dltk.javascript.rhino_2019.12.1.3543.jar:?]
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3534) [org.eclipse.dltk.javascript.rhino_2019.12.1.3543.jar:?]
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107) [org.eclipse.dltk.javascript.rhino_2019.12.1.3543.jar:?]
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:665) [servoy_shared_2019.12.1.3543.jar:?]
at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:393) [servoy_debug_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.component.EventExecutor.executeEvent(EventExecutor.java:234) [servoy_ngclient_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.DataAdapterList.executeEvent(DataAdapterList.java:126) [servoy_ngclient_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.WebFormComponent$FormcomponentEventHandler.executeEvent(WebFormComponent.java:240) [servoy_ngclient_2019.12.1.3543.jar:?]
at org.sablo.BaseWebObject.doExecuteEvent(BaseWebObject.java:335) [sablo_2019.12.1.3543.jar:?]
at org.sablo.BaseWebObject.executeEvent(BaseWebObject.java:324) [sablo_2019.12.1.3543.jar:?]
at org.sablo.services.server.FormServiceHandler.executeEvent(FormServiceHandler.java:137) [sablo_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.NGFormServiceHandler.executeEvent(NGFormServiceHandler.java:503) [servoy_ngclient_2019.12.1.3543.jar:?]
at org.sablo.services.server.FormServiceHandler.executeMethod(FormServiceHandler.java:84) [sablo_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.NGFormServiceHandler.executeMethod(NGFormServiceHandler.java:482) [servoy_ngclient_2019.12.1.3543.jar:?]
at org.sablo.websocket.WebsocketEndpoint$5.run(WebsocketEndpoint.java:408) [sablo_2019.12.1.3543.jar:?]
at org.sablo.eventthread.Event$1.run(Event.java:102) [sablo_2019.12.1.3543.jar:?]
at org.sablo.websocket.CurrentWindow.runForWindow(CurrentWindow.java:76) [sablo_2019.12.1.3543.jar:?]
at org.sablo.eventthread.Event.execute(Event.java:92) [sablo_2019.12.1.3543.jar:?]
at org.sablo.eventthread.EventDispatcher.dispatch(EventDispatcher.java:125) [sablo_2019.12.1.3543.jar:?]
at org.sablo.eventthread.EventDispatcher.run(EventDispatcher.java:89) [sablo_2019.12.1.3543.jar:?]
at com.servoy.j2db.server.ngclient.eventthread.NGEventDispatcher.run(NGEventDispatcher.java:55) [servoy_ngclient_2019.12.1.3543.jar:?]
at java.lang.Thread.run(Unknown Source) [?:?]
derk.hulshof
 
Posts: 103
Joined: Tue Dec 03, 2013 9:18 am
Location: Netherlands

Re: Error when display Time value in field

Postby jcompagner » Mon Mar 09, 2020 5:17 pm

somehow your database returns a java.sql.Time object (so without a date at all, just time)
I made a quick fix that will be in 2020.03_rc2
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8273
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Error when display Time value in field

Postby derk.hulshof » Mon Mar 09, 2020 5:33 pm

Tnx, Will keep an eye on the release of 2020.03
derk.hulshof
 
Posts: 103
Joined: Tue Dec 03, 2013 9:18 am
Location: Netherlands

Re: Error when display Time value in field

Postby derk.hulshof » Tue Mar 24, 2020 9:56 am

Hi Johan,

Thanks for the quick fix.
The display looks correct now.

Going to test it soon with savin data etc.

thanks
derk.hulshof
 
Posts: 103
Joined: Tue Dec 03, 2013 9:18 am
Location: Netherlands


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 2 guests