By Date: <-- -->
By Thread: <-- -->

File system inaccessible to application running under Tomcat



Hello everyone,

I'm having a problem with a java/jsp application running under Tomcat 5.5.12 on Windows. When I start Tomcat from the system tray application or from the windows services window code that checks whether a directory exists incorrectly returns false:

File file = new File(server.dataDirectory);
if (! file.exists())
throw new FileNotFoundException("Data directory " + server.dataDirectory + " for server " + server.shortName + " does not exist.");


If I comment this out the next piece of code (which gets a list of files in the directory) returns no files.

However if I start Tomcat from within either Eclipse (MyEclipse) or Netbeans this does not happen - file.exists() returns true and a complete list of files is returned.

I'm assuming that there is come configuration option that causes Tomcat not to be able to see the local file system but I can't think what it might be - I'm not starting Tomcat with a security manager.

Can anyone help?

Thanks very much,
Steve


Stephen Gray Archive Research Officer Australian Social Science Data Archive 18 Balmain Crescent (Building #66) The Australian National University Canberra ACT 0200

Phone +61 2 6125 2185
Fax +61 2 6125 0627
Web http://assda.anu.edu.au/