• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FileNotFoundException

 
lokesh rajarathnam
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9313
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic