In Servoy 3.5 we have logout method that works great:
function logout()
{
var serverUrl = '/servoy-webclient/templates/default/expired.html'
application.showURL(serverUrl)
application.exit()
}
the user can really logout his session, and will be directed the expired.html page. On that page, we have login, button so he can login back again.
So the customer has total control, over how many licenses he uses, so far so good.
In Servoy 5 webclient, this function is working differently!
after pressing this logout button, the browserpage where you see the solution, gives a message in red: Error calling server, and the expired.html is force to upen in a popup! (with all the warning issue about popups, that comes with firefox, safari, chrome, etc…)
I am having a similar situation like Harjo had, except that doing something like :
if (application.getApplicationType() == APPLICATION_TYPES.WEB_CLIENT) {
application.showURL('http://www.mydomain.nl', "_self");
application.exit();
}
as suggested doesn’t work for me. I am instead getting the following server error on my Admin ‘Server Log’ :
org.mozilla.javascript.WrappedException: Wrapped com.servoy.j2db.Zgf: 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.audit_auditlogout_write_applicationtype(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.Ztb.executeFunction(Ztb.java:196)
at com.servoy.j2db.Zwb.Za(Zwb.java:741)
at com.servoy.j2db.Zwb.Za(Zwb.java:1223)
at com.servoy.j2db.Zcc.Za(Zcc.java:1)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:27)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:18)
at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:16)
at com.servoy.j2db.server.headlessclient.dataui.WebEventExecutor.onEvent(WebEventExecutor.java:156)
at com.servoy.j2db.server.headlessclient.dataui.Zzd.onEvent(Zzd.java:7)
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.Zk.doGet(Zk.java:4)
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.Zgf: Application exit
at com.servoy.j2db.scripting.JSApplication.js_exit(JSApplication.java:37)
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
It looks like a call to ‘application.exit()’ is doing something unexpected. I can’t tell what’s happening - we’ve used this code over and over again and it worked fine until recently. We’re still using ‘Servoy 5.1.4 - build 964’, but I don’t suppose that that is the issue. Or?
I am further getting the following in addition on my Admin ‘Server Log’ :
2010-11-02 14:02 http-8088-2 INFO com.servoy.j2db.util.Debug DECODE an ajax request url: servoy-webclient/?x=4x3uyWTUw44UFADQgZkWqlPm8ChilAwEVC8lHTOf2-1RMCM2e0dqh8ZHK2midM&ignoremp=true&random=0.7843796104761412 with session: 72E5D75C10BEF3EE7CD8C74B39B54715 Aborting.
2010-11-02 14:02 http-8088-4 INFO com.servoy.j2db.util.Debug DECODE an ajax request url: servoy-webclient/?x=4LYoBxWg0qaiO2W*69LuVefquHIj-bqu&random=0.778295247730609 with session: 72E5D75C10BEF3EE7CD8C74B39B54715 Aborting.
First, the logout - application.exit() - was not successful, and then it was followed by the above logging.
The client is expected to goto the URL http://www.mydomain.nl, but this time around, it doesn’t do it - the client just stays in the solution. I occasionally see a ‘server error…’ (something like that) , flash on the webclient and then thats it, the redirection to ‘http://www.mydomain.nl’ doesn’t happen anymore.
Unfortunately, I am unable to use any of Servoy’s latest installers (both the .exe and the .jar) to install Servoy 5.2.2 on a Windows Server 2003, in order to test this issue of
application.showURL('http://www.mydomain.nl', "_self");
``` and
application.exit();
not working.
There seems to be issues with the current Servoy installers working on a Windows Server 2003, unless there is something I am missing - the installers are unable to create db files/sub-folders in the "\application_server\database" folder after an install - the later work fine at least on Vistas and XP machines. The experience I have been writing about here was realized on a Windows Server 2003 machine - that would be the right place to do a test run with a 5.2.2.
Would appreciate a feedback, 10q.
bobpee:
Yes,i have access right to the ‘database’ folder. This is the message in the “\application_server\postgres_db\postgres_log.txt” file after the install
postgres cannot access the server configuration file “C:/Servoy/application_server/database/postgresql.conf”: No such file or directory
Don’t you get any error during install ? Or maybe a firewall is blocking the initialization of the postgres database ?
Hi Laurian,
I have just done yet another install on a 2nd Windows Server 2003, using the latest Servoy 5.2.2 installers that I have - the results is as before, the installation completes leaving the ‘‘C:\Servoy\application_server\database’’ folder empty.
Don’t you get any error during install ?
No
Or maybe a firewall is blocking the initialization of the postgres database ?
There are no firewalls on the machines being used for these installs.
Maybe Servoy should try that too on a Win Server 2003, for we cannot tell what’s going on.
Does this work ? This is the initialization done to the database folder (so is not empty).
Not completely, I have to give full access to user “Everyone” on the folder "\application_server\database’’ to get ```
postgres_db\bin\initdb.exe -D database -E UNICODE -U DBA
Now, the files and sub-folders in "\application_server\database'' have been created, but I am unable to even checkout any of the default solutions that shipped with Servoy 5.2.2.
When I click on the "Database Server" node and further click on the "Refresh view (F5)" button in Servoy eclipse, the db nodes which appeared active when Developer was started, change from active to inactive, which is an indication that the default db connections, like **"bug_db**", **"example_data"**, **"log_server"** etc. and very importantly **"repository_server"** never got started successfully.
Does this tell you anything?