Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.nio.channels.ClosedChannelException #88

Open
guoyuhaoaaa opened this issue Nov 19, 2018 · 1 comment
Open

java.nio.channels.ClosedChannelException #88

guoyuhaoaaa opened this issue Nov 19, 2018 · 1 comment

Comments

@guoyuhaoaaa
Copy link

@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关闭不了,这是为什么呢?

@sinllychen
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants