Win NT 4.0 Server SP 5 (or later)
Running a Java Server as an NT service. The server has a GUI for control and the native app that launches the Server needs to catch the JVM exit code and either restart the Server, exit normally or flag an error.
Because of problems catching exit hooks with the Java Invocation API and Hotspot, we are forced to not use the Invocation API. Instead we use a native starter app (running as a service) to start Java as a sepearate process using the Win32 API call CreateProcess(). The starter app catches the JVM exit value and based on this value the starter app takes the appropriate action. The Java app runs with a GUI but because we use javaw.exe, the console window is not displayed.
This works fine in jdk1.2.2_005
With 1.3.1Beta the Java Server (or more accurately it's GUI) hangs when logging off or when shutting down. After a period (20secs??) a dialog appears asking you to either wait, End Task or cancel. If shutting down, selecting End Task or cancel allows the system to shutdown. When logging off, selecting End task or Cancel usually allows things to continue normally although sometimes a second dialog appears with the same options and sometimes the service dies.
This behaviour seems to be the same whether you use the -Xrs switch or not.
If we use java.exe instead of javaw.exe, the server GUI appears along with a console window. This seems to work correctly.
Name: krC82822 Date: 05/29/2001
java version "1.2.2"
Classic VM (build JDK-1.2.2_006, native threads, symcjit)
1. How to dup the problem:
a. Create a service which will run under local system security context of
Windows NT 4.0, service pack 5. In this service use function CreateProcess() of
Windows APIs to launch the javaw.exe.
b. Log-off, shutdown or restart the PC, will cause an error message that says:
OleMainThreadWndClass: "The Windows application cannot respond to the End Task
request. It may be busy, waiting for a response from you, or it may have
stopped executing." User has 3 options: Cancel/End Task/Wait, but only clicking
on "End Task" button can help!
2. Java code: N/A.
3. Error Message: See above.
4. Trace Information: N/A
5. Configuration: Windows NT 4.0 WS/Server - Fresh installation.
(Review ID: 125335)