I have a program that I've written in Java and have set up with Windows Task Scheduler to run every 5 minutes. It executes "C:\Program Files\Java\jre7\bin\javaw.exe" and passes along the jar file and all of the command-line parameters.
For the most part, this runs perfectly fine, but every now and then, I would come back to my computer and see a popup saying that "Java(TM) Platform SE binary has stopped working". So, at first, I thought it was something to do with my code, and added in a lot of debug statements which were appended to a text file. When it crashed, I checked the text file and there were no incomplete runs listed in it. I then added a print statement to my main method:
public static void main (String[] args) {
System.out.println ("Main Method Called");
new Runner (args);
}
I then constantly ran the Java program from the command-line until it crashed, and I noticed something interesting. On the crash, it never printed "Main Method Called". Now, I find that very interesting, as that tells me that it isn't my Java program that crashed, but instead it is Java itself.
I then moved on and added verbose print statements to my command-line:
java -verbose:class -verbose:gc -verbose:jni -jar ...
From there, I continued the process until the program failed again. When it failed, the output would be much smaller (346 lines) than the successful run (667 lines). Everything in both of the runs is exactly the same up until line 346, when the output abruptly stops. So, that makes me thing that whatever happens on lines 346 or 347 causes it to crash. Here are lines 340-346:
[Loaded sun.nio.cs.StandardCharsets from C:\Program Files\Java\jre7\lib\rt.jar]
[Loaded sun.util.PreHashedMap from C:\Program Files\Java\jre7\lib\rt.jar]
[Loaded sun.nio.cs.StandardCharsets$Aliases from C:\Program Files\Java\jre7\lib\rt.jar]
[Loaded sun.nio.cs.StandardCharsets$Classes from C:\Program Files\Java\jre7\lib\rt.jar]
[Loaded sun.nio.cs.StandardCharsets$Cache from C:\Program Files\Java\jre7\lib\rt.jar]
[Loaded sun.security.action.GetPropertyAction from C:\Program Files\Java\jre7\lib\rt.jar]
[Loaded java.util.Arrays from C:\Program Files\Java\jre7\lib\rt.jar]
In the successful run, the output continues, here are lines 347-355:
[Dynamic-linking native method java.lang.Object.getClass ... JNI]
[Dynamic-linking native method java.lang.Class.forName0 ... JNI]
[Loaded sun.nio.cs.HistoricallyNamedCharset from C:\Program Files\Java\jre7\lib\rt.jar]
[Loaded sun.nio.cs.MS1252 from C:\Program Files\Java\jre7\lib\rt.jar]
[Loaded sun.nio.cs.SingleByte from C:\Program Files\Java\jre7\lib\rt.jar]
[Loaded java.lang.Class$1 from C:\Program Files\Java\jre7\lib\rt.jar]
[Dynamic-linking native method sun.reflect.Reflection.getClassAccessFlags ... JNI]
[Loaded sun.reflect.ReflectionFactory$1 from C:\Program Files\Java\jre7\lib\rt.jar]
[Loaded sun.reflect.NativeConstructorAccessorImpl from C:\Program Files\Java\jre7\lib\rt.jar]
Finally, when it crashes, Windows gives a popup (which I mentioned earlier) containing the following information:
Problem signature:
Problem Event Name: APPCRASH
Application Name: java.exe
Application Version: 7.0.210.11
Application Timestamp: 515d999b
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7601.18247
Fault Module Timestamp: 521eaf24
Exception Code: c0000005
Exception Offset: 00000000000986ea
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: 4c0d
Additional Information 2: 4c0d4d78887f76d971d5d00f1f20a433
Additional Information 3: 4c0d
Additional Information 4: 4c0d4d78887f76d971d5d00f1f20a433
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
After reading the problem signature and seeing "ntdll.dll" listed as the cause, I searched for problems involving that, but I have not found any solutions.
Do you have any ideas what I might be able to do to fix this?