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

FileNotFoundException

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==
xmlsource=projectname/webcontent/myfile.xml

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
Bartender

Joined: Oct 29, 2001
Posts: 8710
    
    6

A relative pathname. . . must be interpreted in terms of information taken from some other pathname. By default the classes in the java.io 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.

java.io.File 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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: FileNotFoundException
 
Similar Threads
JSP files not running (Eclipse 3.4 + Tomcat 5.0)
Servet initialisation settings from a file
How to read a file on the internet?
How can I retrieve the server path from inside the servlet?
/hibernate.cfg.xml not found