0
我试图找出为什么下面的代码被扔的ProcessBuilder扔java.lang.Exception的:
java.lang.Exception的:没有这样的文件或目录
异常
ProcessBuilder send = new ProcessBuilder("/bin/bash","/opt/ftp/scripts/XFER.sh | /opt/ftp/myftp -c /opt/ftp/ftp.conf >> /logging/ftp.log2>&1");
Process sendProcess = send.start();
br = new BufferedReader(new InputStreamReader(sendProcess.getErrorStream()));
builder = new StringBuilder();
line = null;
while ((line = br.readLine()) != null) {
builder.append(line);
builder.append(System.getProperty("line.separator"));
}
if(!builder.toString().isEmpty()){
throw new Exception("ERROR with XFER.sh: "+builder.toString());
}
我试过隔离字符串数组中的参数,但那也不管用。任何想法可能会导致这个堆栈跟踪?
你能编辑你的问题,包括完整的stacktrace,不只是异常类型和消息? –