EasyML icon indicating copy to clipboard operation
EasyML copied to clipboard

java.nio.channels.ClosedChannelException

Open guoyuhaoaaa opened this issue 6 years ago • 1 comments

@sinllychen 当我使用idea开发调试的时候,当提交任务的时候,出现了submit failled,当我定位错误的时候,发现是public static void upload(String uri, String content) throws IOException { Path path = new Path(Constants.NAME_NODE + "/" + uri); if (fs.exists(path)) fs.delete(path, true); OutputStream out = fs.create(path); InputStream rf = new ByteArrayInputStream(content.getBytes()); IOUtils.copyBytes(rf, out, 4096, true); 这个函数错误了,报的是java.nio.channels.ClosedChannelException,好像是out关闭不了,这是为什么呢?

guoyuhaoaaa avatar Nov 19 '18 07:11 guoyuhaoaaa

@guoyuhaoaaa 这个问题没有遇到过之前,你在集群上自己往hdfs上能上传东西吗?不通过代码的情况

sinllychen avatar Jan 07 '19 01:01 sinllychen