File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Java 8 in Action this week in the Java 8 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: 19552
    
  16

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: 19552
    
  16

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.......
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Shared folder not accessible when running tomcat as a service
 
Similar Threads
Accessing chinese folder through URL
Run Web application as Specific user.
Map drive access through Java Application running as a service
Giving path alias to network folder in server.xml
Shared folder not accessible when running tomcat as a service