问题
A Java application running as an scheduled task on Windows 2003 crashed with no logs or anything that would help to find out what happened. The only information available, is that the application returned code 143 (8F). That error code was retrieved from the scheduled tasks log.
Does anyone knows what that error code (143) stands for? Is it possible that an user logging off could cause the application to be terminated?
Thanks,
回答1:
JVM error code 143 means Internal field must be valid. This is discussed on the OTN discussion forums. However, the conclusion seems to be something killed your process.
I suspect this could indeed be caused by a user logging off.
回答2:
143 often means that the application was terminated due to a SIGTERM command. See also https://unix.stackexchange.com/questions/10231/when-does-the-system-send-a-sigterm-to-a-process
However, please note that an application might use 143 for its own custom result.
回答3:
An user logging off would signal the CTRL_LOGOFF_EVENT
signal to all running processes. From https://msdn.microsoft.com/en-us/library/windows/desktop/aa376876(v=vs.85).aspx:
The system also sends the CTRL_LOGOFF_EVENT control signal to every process during a log-off operation.
Now, under certain circumstances it will terminate the Java application with error code 143
(SIGTERM
). See https://bugs.openjdk.java.net/browse/JDK-6871190.
Well, anyway, what you need to stop this from happening is to start Java with the -Xrs
option. From https://www.ibm.com/support/knowledgecenter/SSYKE2_8.0.0/com.ibm.java.win.80.doc/diag/appendixes/cmdline/Xrs.html:
Setting -Xrs prevents the Java™ run time environment from handling any internally or externally generated signals such as SIGSEGV and SIGABRT.
So you should start your Java application with something like:
>java -Xrs -jar myapplication.jar
PS:
The relation between SIGTERM
and 143
number is explained in https://unix.stackexchange.com/questions/10231/when-does-the-system-send-a-sigterm-to-a-process#comment13523_10231.
来源:https://stackoverflow.com/questions/6963811/jvm-returns-error-143