tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jiang, Peiyun" <Peiyun.Ji...@nrc-cnrc.gc.ca>
Subject RE: tomcat as Windows service - access to resources
Date Thu, 07 Apr 2005 16:29:08 GMT
(1) a property is set: cops.monitoredDirectory.win=\\\\dove\\copsxml\\Final
(2) It's then loaded into a Configuration class
(3) It's then passed as a parameter: pathname and the following code is run:

			try {
				File file = new File(pathname);

				if (file.exists() && file.canRead()) {
					watchedFilesVec.add(file);
					logger.info("add monitored directory " + file.getAbsolutePath());
				} else {
					if (file.exists()) {
						logger.warn(file.getAbsolutePath() + " exist but cannot read");
					} else {
						logger.warn(file.getAbsolutePath() + " not exist");
					}
				}
			} catch (Exception e) {
				logger.error("addWatchedFile(String pathname) " + e);
			}

No Rrror or Exception as file.exists() returns false. It's just not seeing the directory.

log file output:
2005-04-07 12:09:50,171 DEBUG (ArticleMonitor.java:117) - addWatchedFile(String pathname)
start
2005-04-07 12:09:50,187  WARN (ArticleMonitor.java:133) - \\dove\copsxml\Final not exist
2005-04-07 12:09:50,187 DEBUG (ArticleMonitor.java:163) - addWatchedFile(String pathname)
end

Peiyun

-----Original Message-----
From: Jason Bainbridge [mailto:jbainbridge@gmail.com]
Sent: April 7, 2005 12:19 PM
To: Tomcat Users List
Subject: Re: tomcat as Windows service - access to resources


On Apr 7, 2005 11:11 AM, Jiang, Peiyun <Peiyun.Jiang@nrc-cnrc.gc.ca> wrote:
> I escaped them. It's working if tomcat started from a script. The servlet cannot see
the directory as a java File.
> Testing for file.exist() returns false.

So your path within your servlet looks like:

\\\\computer\\dir\\mydir

(Note the four back slashes at the beginning)?

And this is while the service is running under the user account? IS
the User Account a domain account?

Again posting details will help a lot, posting a snippet of code isn't
that hard.

Regards,
-- 
Jason Bainbridge
http://kde.org - webmaster@kde.org
Personal Site - http://jasonbainbridge.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message