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:
I don’t know what I changed but now I just got an error in Servoy Server logs:
2009-02-04 10:34 http-8080-1 ERROR com.servoy.j2db.util.Debug Throwable
java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(Unknown Source)
at java.awt.Window.(Unknown Source)
at java.awt.Frame.(Unknown Source)
at java.awt.Frame.(Unknown Source)
at javax.swing.SwingUtilities$SharedOwnerFrame.(Unknown Source)
at javax.swing.SwingUtilities.getSharedOwnerFrame(Unknown Source)
at javax.swing.JDialog.(Unknown Source)
at javax.swing.JDialog.(Unknown Source)
at com.it2be.datastream.mb.(Unknown Source)
at com.it2be.datastream.mb.a(Unknown Source)
at com.it2be.datastream.w.a(Unknown Source)
at com.it2be.common.jc.initialize(Unknown Source)
at com.it2be.datastream.plugin.client.b.initialize(Unknown Source)
at com.servoy.j2db.plugins.PluginManager.initClientPluginsEx(PluginManager.java:82)
at com.servoy.j2db.plugins.PluginManager.initClientPlugins(PluginManager.java:3)
at com.servoy.j2db.server.headlessclient.SessionClient.Zn(SessionClient.java:109)
at com.servoy.j2db.ClientState.applicationInit(ClientState.java:65)
at com.servoy.j2db.server.headlessclient.SessionClient.(SessionClient.java:487)
at com.servoy.j2db.server.headlessclient.HeadlessClientFactory.createSessionBean(HeadlessClientFactory.java:5)
at com.servoy.j2db.server.headlessclient.HeadlessClientFactory.createSessionBean(HeadlessClientFactory.java:7)
at org.apache.jsp.examples.doc2pdf2_jsp._jspService(doc2pdf2_jsp.java:78)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
2009-02-04 10:34 http-8080-1 ERROR com.servoy.j2db.util.Debug Error ocured initializing plugin: it2be_datastream , error: null
So if I refer to these 2 lines:
at com.servoy.j2db.server.headlessclient.HeadlessClientFactory.createSessionBean(HeadlessClientFactory.java:7)
at org.apache.jsp.examples.doc2pdf2_jsp._jspService(doc2pdf2_jsp.java:78)
it confirms that the problem come from this line in my JSP page:
If I am correct you have the DataStream settings for the progress dialog so that it will show.
Change the settings and you should be fine…
Actually I’m not using it2be Datastream plugin in my program. I have the plugin in my “plugins” folder of Servoy but I don’t use it at all in my program.
So I don’t know why I get this error
What version of Servoy are you using?
This should not at all be possible in 4.x when you don’t register.
In 3.x I can imagine that a call to the Plug-in is made even though it is not used.
You can change the setting in smart client preferences or surpress the dialog using the plug-in settings (have a look at the sample solution and/or the plugin tree).
I’m still stuck
And now it’s not even working on my machine with developer
I’ve got new IT2BE errors in servoy_log.txt by the way:
2009-02-16 16:22:55,567 ERROR [Thread-3] com.it2be.components - (No such license file or directory)
2009-02-16 16:22:55,610 ERROR [Thread-3] com.it2be.components - (No such license file or directory)
2009-02-16 16:22:55,614 ERROR [Thread-3] com.it2be.components - Error: Library ‘secman.dll’ is not available!
2009-02-16 16:22:55,806 ERROR [Thread-3] com.it2be.components - (No such license file or directory)
2009-02-16 16:22:57,235 ERROR [Thread-3] com.it2be.components - (No such license file or directory)
In fact I don’t have any license for them. I took the plug-in files from my colleague but I didn’t know I needed the license as well.
So I have deleted the plug-in files and now I don’t get these errors any more.
This is why I don’t like jsp and decided to write my own servlet that handles the request, hands it over to servoy and (when wanted) replies.
Simply to avoid this.
By the way I think I’ve found why my headless client wasn’t working.
In fact I didn’t clear the “servoy” attribute in the session between each launch. Even when I kicked the headless client from the server using the admin page, it didn’t work.
At the end of my program I had to do that: ```
session.setAttribute(“servoy”,null);
Now it seems to work. I generate my pdf in the ROOT directory of Tomcat and redirect the user to the file <img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" />
For some reason now it is not working!
Don’t what I’ve done? I have not changed anything to my code!
So, now it works very well on my laptop using developer. But when I export the solution and import it on a server machine, then try to run the smart client on my laptop, it is stuck!
I have tried to make it as simple as possible. The Smart client is only using one JSP file:
Because of Harjo’s question, I’ve re-installed Servoy on the server with the headless client sample option ticked.
Then, I’ve tried again my solution, running the client from my laptop, but same result
So I’ve tried to run it on the server using Developer on the server, and it doesn’t work as well. However it works using developer on my laptop.
It means that there is definitely something wrong with the server
Now I’ve setup the Servoy Application Server on my laptop and run the client on the Server machine: it worked!
So, the server has something wrong somewhere
And I don’t really see any difference between my laptop and the server machine, except that the laptop is running under Vista and the server under Windows server 2003.
Servoy version is exactly the same (same installer file). I’ll try to re-install it again on the server machine, with every option ticked to see if there is any difference
Otherwise I’ll have to wipe it and start from scratch
in the past, you needed to install the java JDK instead of the JRE to make the headless client work, because of some tools.jar.
Maybe this is still the case?
Yesterday I’ve tried to uninstall the JRE, then install the JDK (with the JRE option).
But it still didn’t work. So I have uninstall everything again and reinstall the JDK without the JRE option.
But it still didn’t work.
Today I’ll try to wipe the server. And install servoy with all options! (like on my laptop).
Do I need the JRE or the JDK only is enough for Servoy? I not sure but I think in the past I had a Java project where the JDK was needed for the development but then the JRE was need for running it or something like that.
I’ve just finished to reinstall everything and I get another weird thing: when I checkout solutions in Servoy Developer I don’t have the Headless Client Demo in the list.
I had selected everything in the installation options including the headless client example.
Another question: on my laptop, which is working fine in Developer and Server mode, I’ve modified my code to work with the database. As a result, the Headless client now makes queries to the database to find which file it has to convert.
This new version is working well using developer. But when I shut it down, start Servoy Application Server service, import the new solution and try it using another machine as client, it gets stuck like when I use the server machine!
Exactly the same issue: stuck without any error raised anywhere in any log