I am invoking some EXE's(7za.exe, pg_basebackup.exe, ...) from JAVA ProcessBuilder. It is working without any issues for 2 or 3 days (EXE will be called daily). After that EXE's are crashing continuously.
7za.exe error:
Exit code :: -1.073.741.502Windows Event log error:
Faulting application name: 7za.exe, version: 9.20.0.0, time stamp: 0x4ce553f5 Faulting module name: KERNELBASE.dll, version: 6.2.9200.21941, time stamp: 0x5792e533
Exception code: 0xc0000142
Fault offset: 0x000683ba
Faulting process id: 0x10bc
Faulting application start time: 0x01d2cebdff3bb05a
Faulting application path: EXEpath\bin\7za.exe
Faulting module path: KERNELBASE.dll
Report Id: 3d27046a-3ab1-11e7-93fe-00505680156e
Faulting package full name:
Faulting package-relative application ID:
Code snippet
File workingDir = new File(workingDirectory);
ProcessBuilder pb = new ProcessBuilder(argumentsList);
pb.redirectErrorStream(true);
pb.directory(workingDir);
Process process = pb.start();
BufferedReader commandOutput = new BufferedReader(new
InputStreamReader(process.getInputStream()));
String s = null;
while ((s = commandOutput.readLine()) != null) {
print(s);
}
int exitCode = process.exitValue();
Also it is not happening in all the machines which run this code. Is it any memory leakage OR OS level error? Please advise.
Thanks in advance.
Edit 1:
Same kind of error in c#. It also contains fix.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/cb9a15ed-4401-47f1-8c78-0c63c3da677d/process-returns-0xc0000142-when-started-from-a-windows-service-prividing-the-credentials?forum=clr
How to achieve it in java?
Edit 2:
Java is running as a service (using wrapper)
Java version : 1.0.051
Windows version : Windows server 2012 and R2(64bit), Windows 7(64bit), Windows 8(64bit)
EXEpath\bin\7za.exe
? maybe you accidentally typed something in a place you shouldn't have :-) – Ivonet