You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Ted Yu <yu...@gmail.com> on 2010/06/10 18:22:57 UTC

Re: Java run-time error while executing my application - unable to find the files on the HDFS

In the future, post snippet of your code.

I suggest you take a look at this method in
core/org/apache/hadoop/fs/FsShell.java:
  private FileSystem getSrcFileSystem(Path src, boolean verifyChecksum
      ) throws IOException {

On Thu, Jun 10, 2010 at 6:42 AM, samanthula <bh...@gmail.com> wrote:

>
> Hello friends,
>                    I have built my own java application that performs some
> map-reduce operations on the input files. I have loaded my files into HDFS
> whose path is as follows:
> /user/sam/input/1.txt
> /user/sam/input/corrected
> /user/sam/input/in
>
> when i used the command $hadoop dfs -cat /user/sam/input/1.txt.. it outputs
> the contents of the file correctly. My application uses the files on HDFS
> as
> java strings as follows
> String str = "hdfs://192.168.1.1:9000/user/sam/input"
>
> String file1 = str + "1.txt"
> String file2 = str + "Corrected"
>
> Here file1 file2 are fed as input to my mapper functions. After i started
> my
> daemons, i ran my application as follows:
> $hadoop jar maximum.jar /user/sam/input/in output
>
> It is generating an error as follows
> Java.io.FileNotFoundException: hdfs://
> 192.168.1.1:9000/user/sam/input/1.txt
> (No such file or directory)
>
> But, when i type $hadoop dfs -cat
> hdfs://192.168.1.1:9000/user/sam/input/1.txt ..... it outputs the contents
> of the file correctly.
>
> I tried other possible ways as follows:
> String str = "/user/sam/input/"
> String str = "hdfs:/user/sam/input"
>
> But none of the above paths works.
>
> Could anyone point out the possible mistake. Any kind of suggestions are
> welcome.
>
> Thanks,
> Bharath
>
>
> --
> View this message in context:
> http://old.nabble.com/Java-run-time-error-while-executing-my-application---unable-to-find-the-files-on-the-HDFS-tp28843314p28843314.html
> Sent from the Hadoop core-user mailing list archive at Nabble.com.
>
>