aspose file tools
The moose likes XML and Related Technologies and the fly likes File not found problem  at runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "File not found problem  at runtime" Watch "File not found problem  at runtime" New topic
Author

File not found problem at runtime

mahesh jhamtani
Greenhorn

Joined: Jan 12, 2001
Posts: 11
Hi,
I am having a problem when I try to run Java program which parses
a XML file.
I am using JAXP for parsing XML file.
It compiles it well, but when I try to run I get error:
Parsing error: File "C:\...\test.xml" not found.
Can anybody tell what is wrong here.
Thanks.

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12325
    
    1
Obviously, something is wrong with the way you pass the location of the file to the parser. I prefer to do something like:
File f = new File( path, filename );
if( !( f.exists() && f.canRead() ){
System.out.println("Can't read: " + f.getAbsolutePath() );
return;
}
Bill

Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: File not found problem at runtime
 
Similar Threads
Xml Error
Jasper Report error
trouble parsing "&" from xml file
parsing an XML file
XML Parsing Error