|
From: Leif M. <le...@ta...> - 2009-11-26 08:36:42
|
Lars, I am very sorry for the delay on this. I discussed this with the team a couple weeks ago and was under the impression it had been replied to. The problem here is that Java decides where to display its GUI by looking at the DISPLAY environment variable. That DISPLAY environment variable does not and can not exist when a daemon process is launched on startup. It will be set in any environments that are created from within the X Windows environment, or which are set manually after the Window manager has been started. If the Wrapper launches the JVM before the Window manager is launched and a user has logged in, then the JVM will already exist with an environment that does not have a DISPLAY variable. It might be possible to get this working if the Wrapper sets the DISPLAY variable and you force a restart of the JVM whenever a user logs in. I will have to test that a bit more. Is this something that would make sense for your application? One solution that I have seen implemented in the past is to have one JVM which is running as a Daemon work horse. Then you launch a second JVM whenever the user logs in that is in charge of the user interface within the window environment. You could then use any number of technologies to communicate between the two JVMs. The GUI JVM would terminate when the user logged out We were talking about coming up with a recommended methodology for setting up systems like this. Starting with Windows Vista, it is no longer possible to have true interactive services, so we need to provide another solution to Windows users as well. I am interested in your feedback on what will and won't work for you, as well as what exactly you are hoping to be able to do and why. Once again sorry for the long delay. Cheers, Leif On Thu, Nov 26, 2009 at 5:05 PM, Lars Schnoor <Lar...@if...> wrote: > Hi again > I guess since there haven't been any replies to this problem, that there > is no solution? > > Lars > > Lars Schnoor wrote: >> Hi >> I would like to have my application which is started as a Linux daemon >> to present a graphical user interface to the user. The user interface is >> written in Java Swing. >> When I try to start the user interface I get an >> java.awt.HeadlessException: >> No X11 DISPLAY variable was set, but this program performed an operation >> which requires it. >> Is there a solution to this? >> Thanks in advance! >> >> Lars |