While connecting to hadoop, getting below error
Exception in thread "main" java.lang.AbstractMethodError: org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider.getProxy()Lorg/apache/hadoop/io/retry/FailoverProxyProvider$ProxyInfo; at org.apache.hadoop.io.retry.RetryInvocationHandler.(RetryInvocationHandler.java:73) at org.apache.hadoop.io.retry.RetryInvocationHandler.(RetryInvocationHandler.java:64) at org.apache.hadoop.io.retry.RetryProxy.create(RetryProxy.java:58) at org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:147) at org.apache.hadoop.hdfs.DFSClient.(DFSClient.java:510) at org.apache.hadoop.hdfs.DFSClient.(DFSClient.java:453) at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:136) at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2653) at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:92) at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2687) at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2669) at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:371) at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:170) at hrumen.HTest.main(HTest.java:26)
Below is my code:
***Path corepath = new Path("/var/tmp/hactive/core-site.xml");
Path sitepath = new Path("/var/tmp/hactive/hdfs-site.xml");
Path yarnpath = new Path("/var/tmp/hactive/yarn-site.xml");
Path mapredpath = new Path("/var/tmp/hactive/mapred-site.xml");
Configuration hconf = new Configuration();
hconf.addResource(corepath);
hconf.addResource(sitepath);
hconf.addResource(yarnpath);
hconf.addResource(mapredpath);
try{
DFSAdmin dfadmin = new DFSAdmin(hconf);
dfadmin.report();
}
catch(Exception e){
//System.out.println("[Exception]: "+e);
e.printStackTrace();
}***
Here part of hdfs-site.xml
...
<property>
<name>dfs.nameservices</name>
<value>mycluster</value>
<final>true</final>
</property>
....
<property>
<name>dfs.client.failover.proxy.provider.mycluster</name>
<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>
In core-site.xml
<property>
<name>fs.defaultFS</name>
<value>hdfs://mycluster</value>
</property>
....