英文:
Java: StackOverflowError for FileSystem.getDefaultUri
问题
I'm trying to create the instance of Distributed FS:
Configuration config = new Configuration();
config.set("fs.defaultFS", "/");
FileSystem hdfs = FileSystem.get(new URI("/"), config);
Application run at distributed cluster.
But receive the following error:
Exception in thread "main" java.lang.StackOverflowError
at java.net.URI.access$300(URI.java:464)
at java.net.URI$Parser.scan(URI.java:2995)
at java.net.URI$Parser.checkChars(URI.java:3018)
at java.net.URI$Parser.parseHierarchical(URI.java:3104)
at java.net.URI$Parser.parse(URI.java:3062)
at java.net.URI.<init>(URI.java:588)
at java.net.URI.create(URI.java:850)
at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:180)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:172)
Also I tried to configure the instance so:
FileSystem hdfs = FileSystem.get(config);
But with the same result.
I have found the ticket for a similar problem: HADOOP-13792
The ticket is resolved for version 2.7.2.
And my version is 3.1.1
英文:
I'm trying to create the instance of Distributed FS:
Configuration config = new Configuration();
config.set("fs.defaultFS", "/");
FileSystem hdfs = FileSystem.get(new URI("/"), config);
Applicaion run at distribited cluster.
But receive the following error:
Exception in thread "main" java.lang.StackOverflowError
at java.net.URI.access$300(URI.java:464)
at java.net.URI$Parser.scan(URI.java:2995)
at java.net.URI$Parser.checkChars(URI.java:3018)
at java.net.URI$Parser.parseHierarchical(URI.java:3104)
at java.net.URI$Parser.parse(URI.java:3062)
at java.net.URI.<init>(URI.java:588)
at java.net.URI.create(URI.java:850)
at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:180)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:172)
Also I tried to configured instanse so:
FileSystem hdfs = FileSystem.get(config);
But with the same result.
I have found the ticket for familiar problem: HADOOP-13792
The ticket is resolved for version 2.7.2.
And my version is 3.1.1
答案1
得分: 1
请为以下部分提供正确的模式和权限:
config.set("fs.defaultFS", "/");
例如 file:///
或 hdfs://namenode:port/
并进行如下更改:
FileSystem hdfs = FileSystem.get(config);
英文:
You should add the correct schema and authority in the
config.set("fs.defaultFS", "/");
Such as file:///
or hdfs://namenode:port/
and change like this
FileSystem hdfs = FileSystem.get(config);
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论