title: Illegal character in authority at index 7: hdfs://localhost:9000 with hadoop
body: <p>I am trying to connect to hdfs.</p>
  
  <pre><code>Configuration configuration = new Configuration();
  configuration.set("fs.default.name", this.hdfsHost);
  fs = FileSystem.get(configuration);
  </code></pre>
  
  <p>hdfsHost is 127.0.0.1:9000.</p>
  
  <p>but get this exception at FileSystem.get();</p>
  
  <p>I have another project running the same code, but works well.
  Could anyone give any suggestion?
  Thank you very much</p>
  
  <p>the exception track:</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException
  at java.net.URI.create(URI.java:842)
  at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:103)
  at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:95)
  at TransferToHadoop.TransferFiles.&lt;init&gt;(TransferFiles.java:50)             
  at.TransferToHadoop.ScheduleTransferJobs.getTransferFiles(ScheduleTransferJobs.java:99)
  at .TransferToHadoop.ScheduleTransferJobs.main(ScheduleTransferJobs.java:30)
   Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: hdfs://localhost:9000  
  at java.net.URI$Parser.fail(URI.java:2809)
  at java.net.URI$Parser.parseAuthority(URI.java:3147)
  at java.net.URI$Parser.parseHierarchical(URI.java:3058)
  at java.net.URI$Parser.parse(URI.java:3014)
  at java.net.URI.&lt;init&gt;(URI.java:578)
  at java.net.URI.create(URI.java:840)
  ... 5 more
  </code></pre>