I wrote a program which runs a method on the Servoy Server when called by the client using JSP pages. Firstly I tried with the client and server on the same machine (developer one) and it works fine.
I'm now trying to make my program working on the server (another machine) with my machine as client. But this time when the method is called on the server it seems to be stuck when creating the headless client. I don't get any error in the logs. The only thing I see, is the headless client and my smart client on the "clients" section of the server administration website.
Here is code of the JSP page which seems to cause the problem:
- Code: Select all
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import = "java.util.*" %>
<%@ page import = "com.servoy.j2db.server.headlessclient.*" %>
<%@ page import = "com.servoy.j2db.util.*" %>
<%@ page import = "com.servoy.j2db.dataprocessing.IDataSet" %>
<%@ page errorPage="errorpage.jsp" %>
<html>
<head>
<meta http-equiv="refresh" content="2;url=doc2pdf3.jsp?idnb=<%= request.getParameter("idnb") %>; charset=UTF-8">
<title>PDF file Generator</title>
</head>
<body onLoad="window.moveTo((screen.availWidth/2)-125,(screen.availHeight/2)-300),window.resizeTo(200,250)">
<BR>
<%
ISessionBean servoy_hc = (ISessionBean)session.getAttribute("servoy");
if (servoy_hc == null)
{
servoy_hc = HeadlessClientFactory.createSessionBean(request,"doc2pdf_test");
session.setAttribute("servoy",servoy_hc);
}
boolean ok = servoy_hc.setMainForm("testForm");
if (!ok)
{
out.print("error cannot work on required form");
return;
}
String docID = request.getParameter("docID");
String idnb = request.getParameter("idnb");
servoy_hc.executeMethod(null,"genPDF",new Object[]{docID,idnb});
out.print("<center>PDF file check...</center>");
%>
</body>
</html>
And the line which seems to cause the problem is:
- Code: Select all
servoy_hc = HeadlessClientFactory.createSessionBean(request,"doc2pdf_test");
doc2pdf_test is the solution name
testForm is the form which contains the genPDF method