File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "file not found error" Watch "file not found error" New topic
Author

file not found error

Norman Meister
Greenhorn

Joined: Jul 03, 2009
Posts: 17
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.



[Thumbnail for yps_1.jpg]


[Thumbnail for yps_2.jpg]

Johannes Uhlmann
Greenhorn

Joined: May 25, 2011
Posts: 5

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

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: http://aspose.com/file-tools
 
subject: file not found error
 
Similar Threads
JSTL Tag lib queries
Jboss-common-client.jar conflict
Missing tag library for portletAPI
The jar synchronization issue seems to be out of hand.
Exception while running struts2 application.