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


lokesh rajarathnam
Ranch Hand

Joined: May 17, 2007
Posts: 35
hi all

I had problem in loding the xml file in to the server.

==The properties file==

i save the xml file in projectname/webcontent/myfile.xml

while i run the project i got the error FileNotFoundException: D:\jboss-4.2.0.GA\bin\projectname\webcontent\myfile.xml
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

A relative pathname. . . must be interpreted in terms of information taken from some other pathname. By default the classes in the package always resolve relative pathnames against the current user directory. This directory is named by the system property user.dir, and is typically the directory in which the Java virtual machine was invoked. JavaDoc

I'm a fan of providing a system property which points to a configuration file. You can also find the deploy directory from the Servlet API if you're using that.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: FileNotFoundException
It's not a secret anymore!