<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Unable to Connect HDFS through java, my hadoop version is 2.9.0. It gives following exception in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-Connect-HDFS-through-java-my-hadoop-version-is-2-9/m-p/231135#M192979</link>
    <description>&lt;P&gt;thanks for reply &lt;/P&gt;&lt;P&gt;After Adding above code previous exception is resolve but it gives new exception  as following, i have added hadoop-hdfs-2.9.0.jar though still it throws following exception&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(Ljava/lang/String;)Ljava/net/InetSocketAddress;
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:99)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3242)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:121)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:3291)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3259)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:470)
at Opts.main(Opts.java:14) &lt;/P&gt;</description>
    <pubDate>Wed, 20 Jun 2018 14:07:13 GMT</pubDate>
    <dc:creator>saurabhambre007</dc:creator>
    <dc:date>2018-06-20T14:07:13Z</dc:date>
    <item>
      <title>Unable to Connect HDFS through java, my hadoop version is 2.9.0. It gives following exception</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-Connect-HDFS-through-java-my-hadoop-version-is-2-9/m-p/231133#M192977</link>
      <description>&lt;PRE&gt;18/06/19 18:40:43 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Exception in thread "main" org.apache.hadoop.fs.UnsupportedFileSystemException: No FileSystem for scheme "hdfs"
	at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:3332)
	at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3352)
	at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:124)
	at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:3403)
	at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3371)
	at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:477)
	at com.Jambo.App.main(App.java:21)


My code is 

import java.io.IOException;
import java.net.URI;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
public class App 
{
    public static void main( String[] args ) throws IOException
    {
        System.out.println( "Hello World!" );
        System.out.println("---143---");
		String localPath="/home/user1/Documents/hdfspract.txt";
		String uri="hdfs://172.16.32.139:9000";
		String hdfsDir="hdfs://172.16.32.139:9000/fifo_tbl";
		
		Configuration conf = new Configuration();
		FileSystem fs = FileSystem.get(URI.create(uri),conf);
		fs.copyFromLocalFile(new Path(localPath),new  Path(hdfsDir));
    }
}
&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jun 2018 20:26:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-Connect-HDFS-through-java-my-hadoop-version-is-2-9/m-p/231133#M192977</guid>
      <dc:creator>saurabhambre007</dc:creator>
      <dc:date>2018-06-19T20:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Connect HDFS through java, my hadoop version is 2.9.0. It gives following exception</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-Connect-HDFS-through-java-my-hadoop-version-is-2-9/m-p/231134#M192978</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/77281/saurabhambre007.html" nodeid="77281"&gt;@Saurabh Ambre&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Try adding these below 2 lines and see if it works.&lt;/P&gt;&lt;PRE&gt;Configuration conf = new Configuration();
conf.set("fs.hdfs.impl", org.apache.hadoop.hdfs.DistributedFileSystem.class.getName());
conf.set("fs.file.impl", org.apache.hadoop.fs.LocalFileSystem.class.getName());&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Please "Accept" the answer if this works. This will be helpful for other community users.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;-Aditya&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 21:46:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-Connect-HDFS-through-java-my-hadoop-version-is-2-9/m-p/231134#M192978</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2018-06-19T21:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Connect HDFS through java, my hadoop version is 2.9.0. It gives following exception</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-Connect-HDFS-through-java-my-hadoop-version-is-2-9/m-p/231135#M192979</link>
      <description>&lt;P&gt;thanks for reply &lt;/P&gt;&lt;P&gt;After Adding above code previous exception is resolve but it gives new exception  as following, i have added hadoop-hdfs-2.9.0.jar though still it throws following exception&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(Ljava/lang/String;)Ljava/net/InetSocketAddress;
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:99)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3242)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:121)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:3291)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3259)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:470)
at Opts.main(Opts.java:14) &lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 14:07:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-Connect-HDFS-through-java-my-hadoop-version-is-2-9/m-p/231135#M192979</guid>
      <dc:creator>saurabhambre007</dc:creator>
      <dc:date>2018-06-20T14:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Connect HDFS through java, my hadoop version is 2.9.0. It gives following exception</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-Connect-HDFS-through-java-my-hadoop-version-is-2-9/m-p/231136#M192980</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/77281/saurabhambre007.html" nodeid="77281"&gt;@Saurabh Ambre&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Glad to know that the previous issue is resolved. It is always good to create a separate thread for each issue. Please create a new issue for this issue so that the main thread doesn't get deviated. Also in the new question , put the complete stack trace and attach the pom.xml file. Feel free to tag me in the question. Please Accept the above answer.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 14:21:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-Connect-HDFS-through-java-my-hadoop-version-is-2-9/m-p/231136#M192980</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2018-06-20T14:21:51Z</dc:date>
    </item>
  </channel>
</rss>

