You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Hassan, Steve" <ha...@essex.ac.uk> on 2001/10/24 12:31:45 UTC

log-off event bug in JDK 1.3.1

Refering to the following:

"Notice for JDK 1.3 users: There is a known problem
<http://developer.java.sun.com/developer/bugParade/bugs/4323062.html> in JDK
1.3 that affects Java applications being run as Windows NT services. The bug
causes the service to terminate when the currently logged in user logs out.
The simplest way to work around this problem is to use JDK 1.2. If your
application requires JDK 1.3 features then you may want to look into
javaserv <http://www.kcmultimedia.com/javaserv/> or JavaService
<http://www.alexandriasc.com/software/JavaService/>. Users have reported
success with both of these packages but there may be others that work as
well. "

I have written my own NT Service program that works fine with JDK1.3.1, and
does not suffer from the logout bug. The solution is to disable the windows
logoff event in the Windows ConsoleControlHandler.

E.g.

BOOL WINAPI ConsoleControlHandler(DWORD dwCtrlType)
{
    switch (dwCtrlType)
	{
    case CTRL_C_EVENT:
	case CTRL_BREAK_EVENT:
    case CTRL_CLOSE_EVENT:
    case CTRL_SHUTDOWN_EVENT:
    case CTRL_LOGOFF_EVENT:
        return TRUE;
    }

    // Let parent handler (the VM) take care of anything else.
    return FALSE;
}


Steve
------------------------------------------
Steve Hassan, Project Programmer

+44 (0)1206 872144 - Direct line
HassanSteve - Instant Messenger
http://dastar.essex.ac.uk/~hasss/
 
UK Data Archive                        
University of Essex       
Wivenhoe Park             
Colchester
Essex CO4 3SQ
United Kingdom
 
+44 (0)1206 872001 - Tel
+44 (0)1206 872003 - Fax
 
www.data-archive.ac.uk  
www.nesstar.org