Ale*_*sky 23 java jvm jvm-hotspot jvm-crash java-8
升级到Java 8后,我的应用程序开始以非确定性方式失败.它不会抛出异常或打印错误消息.失败的唯一标志是退出代码-559038737.有没有遇到过这个?
该退出代码可能来自Apache Commons Exec:
public interface Executor {
/** Invalid exit code. */
int INVALID_EXITVALUE = 0xdeadbeef;
...
Run Code Online (Sandbox Code Playgroud)
Java 8 中的一些更改可能会引入错误。
但在不知道您的类路径和代码的情况下,这只是一个有根据的猜测。
也许您正在使用异步方式来使用 Commons Exec:
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
Executor executor = new DefaultExecutor();
executor.execute(cmdLine, resultHandler);
int exitValue = resultHandler.waitFor();
return exitValue;
Run Code Online (Sandbox Code Playgroud)
那么异常只在resultHandler中捕获,但不会自动打印在stderr上?