solutionModel is not defined

Forum to discuss the new web client version of Servoy.

solutionModel is not defined

Postby kevinounet » Wed Apr 19, 2017 9:47 pm

Hi,
When I run my solution with NGClient, I get the error: "solutionModel is not defined". What is strange is that I do not get the error with WebClient.
Is it a known limitation?
Best regards,
kevinounet
 
Posts: 4
Joined: Wed Apr 19, 2017 9:43 pm

Re: solutionModel is not defined

Postby Andrei Costescu » Thu Apr 20, 2017 8:20 am

No, solution model works with NGClient as well.
Where is the code that tries to use it?

Any other errors in the app. server log file before that one?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: solutionModel is not defined

Postby kevinounet » Thu Apr 20, 2017 9:54 pm

The full log is the following:
Code: Select all
org.mozilla.javascript.EcmaError: ReferenceError: "solutionModel" n'est pas défini (/Users/kevin/servoy_workspace/etape3d5/forms/Qformulaire.js#471)
     at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3772)
     at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3756)
     at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3825)
     at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1827)
     at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1758)
     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1865)
     at script.effacerTout(/Users/kevin/servoy_workspace/etape3d5/forms/Qformulaire.js:471)
     at script.DebutQuestionnaire(/Users/kevin/servoy_workspace/etape3d5/forms/PageConsultation.js:332)
     at script.DebutConsultation(/Users/kevin/servoy_workspace/etape3d5/forms/PageConsultation.js:1108)
     at script.DemarrerConsultation(/Users/kevin/servoy_workspace/etape3d5/forms/PageConsultation.js:300)
     at script.retourPopQuestionnaire(/Users/kevin/servoy_workspace/etape3d5/forms/PageConsultation.js:1334)
     at script.onHide(/Users/kevin/servoy_workspace/etape3d5/forms/PopQuestionnaire.js:187)
     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:837)
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:158)
     at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:406)
     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3204)
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:156)
     at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:664)
     at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:393)
     at com.servoy.j2db.BasicFormController.executeFunction(BasicFormController.java:1063)
     at com.servoy.j2db.BasicFormController.executeFormMethod(BasicFormController.java:782)
     at com.servoy.j2db.BasicFormController.executeOnHideMethod(BasicFormController.java:662)
     at com.servoy.j2db.BasicFormController.notifyVisible(BasicFormController.java:398)
     at com.servoy.j2db.server.ngclient.component.WebFormController.notifyVisible(WebFormController.java:729)
     at com.servoy.j2db.server.ngclient.NGFormServiceHandler.executeMethod(NGFormServiceHandler.java:208)
     at org.sablo.websocket.WebsocketEndpoint$4.run(WebsocketEndpoint.java:300)
     at org.sablo.eventthread.Event$1.run(Event.java:100)
     at org.sablo.websocket.CurrentWindow.runForWindow(CurrentWindow.java:77)
     at org.sablo.eventthread.Event.execute(Event.java:90)
     at org.sablo.eventthread.EventDispatcher.dispatch(EventDispatcher.java:125)
     at org.sablo.eventthread.EventDispatcher.run(EventDispatcher.java:89)
     at com.servoy.j2db.server.ngclient.eventthread.NGEventDispatcher.run(NGEventDispatcher.java:55)
     at java.lang.Thread.run(Thread.java:745)


I also get an error just before that one : org.sablo.websocket.WebsocketEndpoint:
Code: Select all
java.lang.NullPointerException
     at org.sablo.websocket.WebsocketEndpoint.incoming(WebsocketEndpoint.java:281)
     at com.servoy.j2db.server.ngclient.endpoint.NGClientEndpoint.incoming(NGClientEndpoint.java:59)
     at sun.reflect.GeneratedMethodAccessor189.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:498)
     at org.apache.tomcat.websocket.pojo.PojoMessageHandlerPartialBase.onMessage(PojoMessageHandlerPartialBase.java:71)
     at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:395)
     at org.apache.tomcat.websocket.server.WsFrameServer.sendMessageText(WsFrameServer.java:107)
     at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:500)
     at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:295)
     at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:130)
     at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:70)
     at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:148)
     at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:54)
     at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53)
     at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789)
     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437)
     at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
     at java.lang.Thread.run(Thread.java:745)


Do you think that is the reason of the solutionModel error?
kevinounet
 
Posts: 4
Joined: Wed Apr 19, 2017 9:43 pm

Re: solutionModel is not defined

Postby kevinounet » Sat Apr 22, 2017 3:55 pm

So do you have any idea of what happened?
kevinounet
 
Posts: 4
Joined: Wed Apr 19, 2017 9:43 pm

Re: solutionModel is not defined

Postby Andrei Costescu » Thu Apr 27, 2017 11:23 am

What version of Servoy do you use? (I need this info to understand the NullPointerException)

Can you post that line at ".../forms/Qformulaire.js#471" that accesses solutionModel?
From the first stack trace it looks like "Qformulaire" form is trying to access solutionModel in the onHide of form "PopQuestionnaire". But I don't see a reason for that to fail.

(I was on vacation for a while, sorry for the late post)
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: solutionModel is not defined

Postby kevinounet » Wed May 17, 2017 9:44 pm

Hi,
Thank you for your reply!
The version I use is Servoy 8.1.2
The line is:
Code: Select all
solutionModel.removeForm("Qformulaire")


Does that help?
kevinounet
 
Posts: 4
Joined: Wed Apr 19, 2017 9:43 pm

Re: solutionModel is not defined

Postby Andrei Costescu » Fri May 26, 2017 9:17 am

It looks like the connection to client is being closed from the server (I think) for some reason but a few websocket messages from the client still arrive.
One such message that was being handled manages to execute a form hide (but the client is already closed or closing => solutionModel is already cleaned-up/undefined), while the other fails completely because when it arrives more state is already destroyed.

I can't see exactly what triggers the close of the solution/session though. Can you reproduce this? A case (ideally with a sample) would be appreciated.

There was a small fix in 8.1.3 that fixed something like this - when the solution was doing log-off server-side after showing an external URL (so it redirected to some other site + logoff) in a event handler while there were still pending calls from the client to be executed (user for example clicked something more in browser or some other websocket traffic was pending). But I am not sure that this is the case for you as well; it might be something different.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: solutionModel is not defined

Postby Andrei Costescu » Fri May 26, 2017 1:15 pm

I see there is already a similar case SVY-11151.
So you can add a sample to that one as well instead of creating a new one.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 6 guests

cron