title: Hadoop 2.6.0 Browsing filesystem Java
body: <p>I have installed a basic hadoop cluster on CentOS 6.6 and want to write a few basic programs (browse the filesystem, delete/add files, etc) but I'm struggling to get even the most basic app working.</p>
  
  <p>When running some basic code to list the contents of a directory to the console I get the following error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.ipc.RPC.getProxy(Ljava/lang/Class;JLjava/net/InetSocketAddress;Lorg/apache/hadoop/security/UserGroupInformation;Lorg/apache/hadoop/conf/Configuration;Ljavax/net/SocketFactory;ILorg/apache/hadoop/io/retry/RetryPolicy;Z)Lorg/apache/hadoop/ipc/VersionedProtocol;
      at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:135)
      at org.apache.hadoop.hdfs.DFSClient.&lt;init&gt;(DFSClient.java:280)
      at org.apache.hadoop.hdfs.DFSClient.&lt;init&gt;(DFSClient.java:245)
      at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:100)
      at mapreducetest.MapreduceTest.App.main(App.java:36)
  </code></pre>
  
  <p>My pom.xml dependencies</p>
  
  <pre><code>          &lt;dependencies&gt;    
              &lt;dependency&gt;                                                                                                                                       
                  &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;                                                                                                           
                  &lt;artifactId&gt;hadoop-common&lt;/artifactId&gt;                                                                                                         
                  &lt;version&gt;2.6.0&lt;/version&gt;                                                                                            
              &lt;/dependency&gt;  
  
              &lt;dependency&gt;
                &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;
                &lt;artifactId&gt;hadoop-core&lt;/artifactId&gt;
                &lt;version&gt;1.2.1&lt;/version&gt;
              &lt;/dependency&gt;       
            &lt;/dependencies&gt;
  </code></pre>
  
  <p>The code:</p>
  
  <pre><code>import java.io.IOException;
  import java.net.URI;
  import java.net.URISyntaxException;
  
  import org.apache.hadoop.conf.Configuration;
  import org.apache.hadoop.fs.FileStatus;
  import org.apache.hadoop.fs.FileSystem;
  import org.apache.hadoop.fs.Path;
  import org.apache.hadoop.hdfs.DistributedFileSystem;
  
  public class App 
  {   
      public static void main( String[] args ) throws IOException, URISyntaxException
      {
  
  
          Configuration conf = new Configuration();
          FileSystem fs = new DistributedFileSystem();
          fs.initialize(new URI("hdfs://localhost:9000/"), conf);
  
  
          for (FileStatus f :fs.listStatus(new Path("/")))
          {
              System.out.println(f.getPath().getName());                  
          }
  
          fs.close();
  
      }
  }
  </code></pre>
  
  <p>The error is being thrown after calling fs.initialize(). I'm really not sure what the issue is here. Am I missing dependencies? Are they the wrong version? </p>