wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Problem accessing network drives / changing log on user Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem accessing network drives / changing log on user" Watch "Problem accessing network drives / changing log on user" New topic
Author

Problem accessing network drives / changing log on user

Jon Pincott
Greenhorn

Joined: Jul 28, 2004
Posts: 17
I am running Tomcat 5.0.28 on Windows 2000, and I'm having a problem with accessing files on a network drive.

I've written a servlet to help me investigate and it proves that I can access local files/directories with no problems, but mapped drives and network resources aren't visible to the servlet. As I understand it, this is due to the security constraints for the "LocalSystem" account, which Tomcat is running as by default.

My problem comes when I try to change the log on account. I am using the "Configure Tomcat" application to change the logon account but it doesn't seem to make any difference, and I can't tell if the change is persisting as when I reopen the configuration window the account reverts to "Local System account".

Can anyone tell me how to configure Tomcat to allow access to network resources?

P.S. Can a servlet determine what user it is running as? That would be useful debug info.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

If you're running Tomcat as a Windows service, you can set this from the services window. Right click on Apache Tomcat, go to properties, and set the user.

I've also found that I have to use UNC names.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jon Pincott
Greenhorn

Joined: Jul 28, 2004
Posts: 17
Thanks, that worked. Is there a reason why the Tomcat configuration tool doesn't work?
 
 
subject: Problem accessing network drives / changing log on user