Delving into headless client plugin for the first time and what seems like easy stuff is proving not so easy. I assume the following code snippet is correct and it does start up a headless client instance according to the Server:
var jsclient = plugins.headlessclient.createClient("_dsa_mosaic_WEB_cms", null, null, null)
First of all, debugger doesn’t proceed with method after that line – it bounces out as if the method is done.
Secondly, it freezes my currently open smart client. Can’t click anything. It won’t even close, even if killed from the debugger.
No errors in the server log.
Having to restart Servoy every time to figure this out is driving me crazy.
so only creating the client goes wrong?
You don’t even call a method yet?
Can you create a stackdump from the admin page?
Are you sure that there are no errors what so ever in any of the log file of the developer?
an application.output(jsclient) right after that createClient() call is never printed?
yes because it is completely blocked, it doesn’t step any futher
This is because what you load in the headless client is a solution and a form that has beans again on it and it tries to create an image from that
Problem is that can only be done in the event thread, which is blocked by the createClient code… So a deadlock
Please load a simple solution as the headless client, so a solution with an empty start form…
It doesn’t make any sense to have a headless client solution that has ui…
This is quite hard to fix for us, (it works on a real smartclient/appserver combination, but not in the developer)
We’ve narrowed it down to an issue we’ve worked around before in the CMS where headless client in Developer takes as its startup context the current activated solution in developer instead of the solution the headless client is starting up. So the solution that actually starts up as headless client is the current activated solution instead of the solution called in the method.
In my screenshot then, solution “DATASUTRA” is the solution getting started up (and it has all the beans) even though I am trying to start up “_dsa_mosaic_WEB_cms”. If I set “_dsa_mosaic_WEB_cms” as the active solution, my code works fine.
Now that I’ve figured it out easy enough to trap for developer and work around this for now so not a top priority. Wouldn’t have caught it as easy without your beans comment, thanks for that.
To be complete the other place this issue happens is when starting up headless client from a jsp file when running from developer. No matter what application context you specify, the current activated solution in developer is the solution that gets started up:
<%
// start servoy session
ISessionBean servoy_hc = (ISessionBean)application.getAttribute("servoy");
if (servoy_hc == null) {
servoy_hc = HeadlessClientFactory.createSessionBean(request,"_dsa_mosaic_WEB_cms");
application.setAttribute("servoy",servoy_hc);
}
boolean ok = servoy_hc.setMainForm("WEB_0__controller");
if (!ok) {
out.print("Error cannot work on required form");
return;
}
%>
When running from Servoy Server, the supplied solution context works correctly.
make a feature request for this so that the headless client also is able to load directly a module instead of the main application.
It must be a module, i don’t think we can get easy around the fact that it has to be a active solution/module. But maybe we could make it so that it can be a module that it loads instead of the main solution.
jcompagner:
make a feature request for this so that the headless client also is able to load directly a module instead of the main application.
It must be a module, i don’t think we can get easy around the fact that it has to be a active solution/module. But maybe we could make it so that it can be a module that it loads instead of the main solution.
hi! I am using servoy6. is the “freeze” in developer for headless client already resolved?