|
From: Leif M. <le...@ta...> - 2006-02-24 02:10:29
|
Anat,
> The process terminates when I logout, or at least that's how it seems.
> I know the wrapper is not shutting it down, however I thought the
> wrapper is supposed to intercept those signals so that the JVM doesn't
> get them.
The Wrapper is capable of catching and handling many signals, but the JVM
is a separate child process of the Wrapper. If it receives a kill -9,
there is not
anything that can be done about it. At that point, the os is killing
the process
at a very low level. This is true on Windows as well if the user kills
the java
process from the task manager. Processes in both platforms are protected
by user privileges. But if the user has the privilege to kill the
process, it goes
bye bye.
> I think the wrapper wouldn't be able to restart the application for
> other reasons as well, but in any case restarting is not the solution
> for this problem.
I agree, the reason for the restart not working makes sense in your case.
The question is, who is killing the initial java process?
> The original invocation also had a window, but hidden. I am checking
> whether running in service mode, and if so I have the window hidden.
> This is currently easier for me to do than to disentangle the GUI code
> from the application. I plan to separate them, but I hope it will not
> be necessary to do it now. Please let me know if it is...
I wonder if the JVM is creating some hooks into the window manager simply
by allocating the resources for a window, even if that window is not being
displayed?
Could you create a simple headless application and try this out on your
machine? I would like to find out if this is being caused by hidden GUI.
I'll try this out on my home linux machine over the weekend. I only have
access to remote systems today.
Cheers,
Leif
> Leif Mortenson wrote:
>> Anat,
>> Sorry for the delay. wrapper.log.service_normal and
>> wrapper.log.console
>> are the runs that work correctly right? They both appear to be
>> running and
>> shutting down correctly.
>>
>> Both wrapper.log.service_local_logout and
>> wrapper.log.service_vnc_logout
>> Contain output like the following:
>> DEBUG | wrapper | 2006/02/14 16:20:45 | Signal trapped. Details:
>> DEBUG | wrapper | 2006/02/14 16:20:45 | signal number=17
>> (SIGCHLD), source="unknown"
>> DEBUG | wrapper | 2006/02/14 16:20:45 | Received SIGCHLD, calling
>> wait().
>> DEBUG | wrapper | 2006/02/14 16:20:45 | wait() returned, child
>> process should be gone.
>> DEBUG | wrapper | 2006/02/14 16:20:45 | Signal trapped. Details:
>> DEBUG | wrapper | 2006/02/14 16:20:45 | signal number=17
>> (SIGCHLD), source="unknown"
>> DEBUG | wrapper | 2006/02/14 16:20:45 | Received SIGCHLD, calling
>> wait().
>> DEBUG | wrapper | 2006/02/14 16:20:45 | wait() returned, child
>> process should be gone.
>> DEBUG | wrapperp | 2006/02/14 16:20:45 | socket read no code (closed?).
>> DEBUG | wrapper | 2006/02/14 16:20:45 | JVM process is gone.
>> ERROR | wrapper | 2006/02/14 16:20:45 | JVM exited unexpectedly.
>>
>> The JVM appears to be running along perfectly normally then its
>> process
>> suddenly terminates. The Wrapper is not shutting it down. It just
>> dies as if
>> it crashed or its process was killed with 'kill -9'. The Wrapper is
>> viewing this
>> as a crash and attempts to restart the application.
>> It restarts the Java process successfully, but the application is
>> throwing
>> an exception because it is not able to display a window because a
>> display
>> no longer exists:
>> INFO | jvm 2 | 2006/02/14 16:20:57 | Caused by:
>> java.lang.InternalError: Can't connect to X11 window server using
>> 'jupiter.eng.tau.ac.il:8.0' as the value of the DISPLAY variable.
>> INFO | jvm 2 | 2006/02/14 16:20:57 | at
>> sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
>>
>> Since this is happening on a restart, I assume that this means
>> that the
>> original invocation also had a window up? It may be that the window is
>> system is sending a kill -9 to all processes with windows that do not
>> shutdown on their own when the Window manager shuts down the display.
>> I will have to play around with trying to reproduce this. But it
>> may depend
>> on the window manager you are using.
>>
>> I mentioned this before, but add code like the following in your
>> code to
>> make sure that your application never shows a gui when it is being
>> run as
>> a daemon / service process:
>>
>> if ( WrapperManager.isLaunchedAsService() )
>> {
>> // Windowless mode
>> }
>> else
>> {
>> // Show GUI.
>> }
>>
>> Cheers,
>> Leif
<snip history>
|