This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Shared folder not accessible when running tomcat as a service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Shared folder not accessible when running tomcat as a service" Watch "Shared folder not accessible when running tomcat as a service" New topic
Author

Shared folder not accessible when running tomcat as a service

narayana Ega
Greenhorn

Joined: Aug 23, 2012
Posts: 26
Shared folder not accessible when running tomcat as a service



I am running tomcat as a service. I have deployed webservice for my application. The web service implementation

needs to access shared folder on remote PC. Using NetUse I have already mapped the network drive for the shared

folder. I am able to open that shared folder using the network drive on windows explorer.

when running tomcat as a service my webservice is not able to access the shared folder. However if I don't run

tomcat as a service and run it from batch file it is able to access the same shared folder.

Is there specific settings to be done for tomcat when it is executed as a service?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

It needs to run as someone who has access to the share. By default all services run as some local system account which doesn't have access. You need to change the user the service runs as from the Services screen.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
narayana Ega
Greenhorn

Joined: Aug 23, 2012
Posts: 26
I have access to the shared folder. I am able to access it generally...where i am not from tomcat...

if it is necessary to provide credentials, where i have to provide the credentials?

please reply......

Thanks.............
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

Rob Spoor wrote:You need to change the user the service runs as from the Services screen.

Open Control Panel -> Administrative Tools -> Services. Double click on the Tomcat service. Go to the Log On tab. Select "This account", then fill in your credentials.
narayana Ega
Greenhorn

Joined: Aug 23, 2012
Posts: 26
Thank You Very much now the problem is solved.......
 
 
subject: Shared folder not accessible when running tomcat as a service