• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

file not found error

 
Norman Meister
Ranch Hand
Posts: 52
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
This is somehow a very basic question, but surprisingly I am stuck in it
I am getting this exception:

[AirlineBaggageReader] Error:java.io.FileNotFoundException:....

I am trying to read in my java file [AirlineBaggageReader.java] 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?

Thanks.
yps_1.jpg
[Thumbnail for yps_1.jpg]
file structure
yps_2.jpg
[Thumbnail for yps_2.jpg]
generated target file structure
 
Johannes Uhlmann
Greenhorn
Posts: 5
C++ Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Johannes
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic