在这里你去https://docs.oracle.com/javase/7/docs/api/java/io/IOException.html
在输入输出操作期间发生错误时抛出IOException。这可以是读/写文件,流(任何类型),网络连接,与队列的连接,数据库等,几乎任何与从软件到外部介质的数据传输有关的事情。
为了解决这个问题,您可能希望查看异常的堆栈跟踪或至少查看消息,以查看抛出异常的确切位置以及原因。
try {
methodThrowingIOException();
} catch (IOException e) {
System.out.println(e.getMessage()); //if you're using a logger, you can use that instead to print.
//e.printStackTrace(); //or print the full stack.
}
将打印的错误消息可能会显示问题所在。如果您在此处添加错误消息,我将能够为您提供有关如何修复特定IOException的更多信息。没有它,没有人能真正给你一个完整的答案。