Hi Johan,
I have done some more testing, using Servoy 5.2.2 (and same code) on a Windows Vista and Windows Server 2003. In both cases, a call to :
- Code: Select all
if (application.getApplicationType() == APPLICATION_TYPES.WEB_CLIENT) {
application.showURL('http://www.mydomain.nl', "_self");
application.exit();
}
to logout of our solution still seems to throw error on "application.exit()" and a redirection to an URL like "http://www.mydomain.nl" does not work anymore in a webclient. Note the following strange behavior though :
1. When our solution is started using an ip-addressing like
http://10.0.0.12/servoy-webclient/solut ... mysolution , a logout attempt redirect to any URL that I put in the (), although the Server still throw the error as listed below on the 'admin' page;
2. When our solution is started using a public-domain like
http://www.mydomain.nl/servoy-webclient ... mysolution , a logout attempt throws an "error calling server" shows on top-right corner of the webclient, the user is kept on the solution, the "application.showURL()" does not work, and the Server still throw the error as listed below on the 'admin' page;
These are the Server logs on the admin pages of both machines when calls to logouts were made:
Windows Server 2003:2010-11-09 11:43 http-8088-4 INFO com.servoy.j2db.util.Debug shutDown
2010-11-09 11:43 http-8088-4 WARN com.servoy.j2db.util.Debug Solution already closed, ignoring exception
org.mozilla.javascript.WrappedException: Wrapped com.servoy.j2db.ExitScriptException: Application exit (myappl_exit_method#377)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1828)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:199)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666)
at script.myappl_exit_method(myappl_exit_method:377)
at script.onClose(onClose:10)
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:3127)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:458)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3972)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3860)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3782)
at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3637)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:270)
at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:217)
at com.servoy.j2db.server.headlessclient.dataui.WebEventExecutor.onEvent(WebEventExecutor.java:348)
at com.servoy.j2db.server.headlessclient.dataui.WebEventExecutor$2.onEvent(WebEventExecutor.java:152)
at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:286)
at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:119)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
at com.servoy.j2db.server.servlets.Zl.doGet(Zl.java:15)
at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
Caused by: com.servoy.j2db.ExitScriptException: Application exit
at com.servoy.j2db.scripting.JSApplication.js_exit(JSApplication.java:1222)
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)
... 42 more
2010-11-09 11:43 http-8088-4 INFO com.servoy.j2db.util.Debug Unregistering client: EC965722-8142-473B-9741-51D98B84004C
2010-11-09 11:43 http-8088-4 INFO com.servoy.j2db.util.Debug shutDown
2010-11-09 11:43 http-8088-1 INFO com.servoy.j2db.util.Debug questiondata[1] = 2 ,type: java.lang.Integer
2010-11-09 11:43 http-8088-1 INFO com.servoy.j2db.util.Debug questiondata[0] = 'Administrators' ,type: java.lang.String
2010-11-09 11:43 http-8088-1 INFO com.servoy.j2db.util.Debug used sql select user_uid from servoy_users su, servoy_user_groups sug, servoy_groups sg where sg.group_name = ? and sg.group_id = sug.group_id and sug.user_id = su.user_id limit ? questiondata.length 2
2010-11-09 11:43 http-8088-1 INFO com.servoy.j2db.util.Debug QuerySet { updates = <null>, select = select user_uid from servoy_users su, servoy_user_groups sug, servoy_groups sg where sg.group_name = ? and sg.group_id = sug.group_id and sug.user_id = su.user_id limit ? [[Administrators,2]] <0^2>, cleanups = <null> }
2010-11-09 11:43 http-8088-1 INFO com.servoy.j2db.util.Debug CUSTOM ELEMENT select user_uid from servoy_users su, servoy_user_groups sug, servoy_groups sg where sg.group_name = ? and sg.group_id = sug.group_id and sug.user_id = su.user_id ([Administrators]) FILTER null
2010-11-09 11:43 http-8088-1 INFO com.servoy.j2db.util.Debug Analysing filters null
2010-11-09 11:43 http-8088-1 INFO com.servoy.j2db.util.Debug sql select CUSTOM ELEMENT select user_uid from servoy_users su, servoy_user_groups sug, servoy_groups sg where sg.group_name = ? and sg.group_id = sug.group_id and sug.user_id = su.user_id ([Administrators])
Windows Vista:2010-11-09 11:57 http-8080-3 INFO com.servoy.j2db.util.Debug shutDown
2010-11-09 11:57 http-8080-3 WARN com.servoy.j2db.util.Debug Solution already closed, ignoring exception
org.mozilla.javascript.WrappedException: Wrapped com.servoy.j2db.ExitScriptException: Application exit (myappl_exit_method#377)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1828)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:199)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666)
at script.myappl_exit_method(myappl_exit_method:377)
at script.onClose(onClose:10)
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:3127)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:458)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3972)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3860)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3782)
at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3637)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:270)
at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:217)
at com.servoy.j2db.server.headlessclient.dataui.WebEventExecutor.onEvent(WebEventExecutor.java:348)
at com.servoy.j2db.server.headlessclient.dataui.WebEventExecutor$2.onEvent(WebEventExecutor.java:152)
at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:286)
at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:119)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
at com.servoy.j2db.server.servlets.Zl.doGet(Zl.java:15)
at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
Caused by: com.servoy.j2db.ExitScriptException: Application exit
at com.servoy.j2db.scripting.JSApplication.js_exit(JSApplication.java:1222)
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)
... 42 more
2010-11-09 11:57 http-8080-3 INFO com.servoy.j2db.util.Debug Unregistering client: F6853D6F-F774-4BFB-B883-76A8C00FBC0B
2010-11-09 11:57 http-8080-3 INFO com.servoy.j2db.util.Debug shutDown
Does the above tell something? Is/Are there a/ workaround?
As indicated earlier on, we have been using this very code over and over again and it had worked fine. I don't suppose that it is an OS or a Servoy version issue (this behavior started showing up recently in our Servoy 5.1.4 and it is still showing in Servoy 5.2.2), at least this time around - that is why I did testing on 2 different Windows OSs - must be due to something else.
If the redirection were to happen and server still threw an error in the server log or admin page, I would say that we'd have managed with that, however, keeping the user still in the solution when the intention is to log out of the solution is what is disturbing.