File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes file not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "file not found error" Watch "file not found error" New topic

file not found error

Norman Meister
Ranch Hand

Joined: Jul 03, 2009
Posts: 48
Hi All,
This is somehow a very basic question, but surprisingly I am stuck in it
I am getting this exception:


I am trying to read in my java file [] an xml file [ypsilonBaggage.xml]
but somehow the class does not able to locate the xml file and hence the exception.

If you look at the two attached images, you'll get to know the directory structure.

This is my file reading function

I have called the function with variety of paths but no luck.

I am using eclipse IDE and here is the projects .classpath file

I am using linux for deployment.

Please help me out?


[Thumbnail for yps_1.jpg]

[Thumbnail for yps_2.jpg]

Johannes Uhlmann

Joined: May 25, 2011
Posts: 5


maybe you could try locating the file on the disk (using find or something like that), and then you will know its path?

James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

I don't know the solution to the reported problem but your method readFileAsString() looks to be flawed. It assumes that a single byte can be cast to a char which in general is not true. Converting bytes to characters requires the use of a character coder/decoder.

Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
I agree. Here's the link:
subject: file not found error
It's not a secret anymore!