RMK
RMK

Reputation: 456

Can't access Network folders through Apache Tomcat

I have a .war file published on Apache Tomcat 7.0. The application accesses a folder and displays the filenames of the files inside. This is working perfectly when the folder is on the local machine. However when the folder in on the Network server (accessed through \\192.168.x.xx\foldername) then the application can't access it and displays "No files found").

We've tried searching for a possible solution but didn't find anything that seemed related to this specific issue. We also tried the usual solutions like granting access (sharing), running the application as Administrator, even checking Tomcat users settings but nothing worked. So my question is, what do we need to do to allow the application to access that network folder. I also should mention that when the application is running from Eclipse, it can access the folder without any problems. Thanks.

Upvotes: 1

Views: 5185

Answers (2)

alfonzjanfrithz
alfonzjanfrithz

Reputation: 786

You can trick it out by modifying the service properties not to use Local System account and explicitly put the account that already has privilege. (even though you are already logged in using it)

I hope it helps.

Upvotes: 0

David Ehrmann
David Ehrmann

Reputation: 7576

This has nothing to do with Tomcat. For one, \\host\share is the Windows-specific way to access a CIFS/SMB share from an Explorer window; it won't work on *nix where you have to mount the share to a directory. If you're willing to change the code in the war, take a look at Java open file on shared location or at JCIFS. Or if you map the share to a network drive, you can do z:\....

Upvotes: 1

Related Questions