Reputation: 2221
I am trying to read to check if a file exists on HDFS. I am using eclipse IDE and have all the required hadoop jars and hadoop configuration in class path. When i execute the program i see the below exception.
Configuration conf = new Configuration(true);
conf.addResource(new File("core-site.xml").toURI().toURL());
conf.addResource(new File("hdfs-site.xml").toURI().toURL());
conf.addResource(new File("mapred-site.xml").toURI().toURL());
FileSystem hdfs = FileSystem.get(conf);
boolean isExists = hdfs.exists(source);
Exception:
java.io.IOException: Couldn't create proxy provider class org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider
at org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider.<init>(ConfiguredFailoverProxyProvider.java:93)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
Can anyone help me fix this issue?
Upvotes: 1
Views: 14057
Reputation: 740
<property>
<name>dfs.client.failover.proxy.provider.**your-cluster-name**</name>
<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>
This should be your cluster name, I guess it is also case-sensitive.
Upvotes: 0