• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

System cannot find the path specified

 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have mapped my "R" drive to a network shared location (I have read/write access to this shared location)

When I am trying to create file using Servlet Action class I get the following error
R:\SUNONELOCAL.txt (The system cannot find the path specified)

but if I try to do the same through standalone program it works fine

Can anyone please suggest what could be the reason for it

Thanks in advance


From standalone program


From Action class code is

 
Ranch Hand
Posts: 254
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two reasons:
(1) In windows, a mapped network drive is per user only -> if you see the network path under R: doesn't mean that the service account running servlet container can see it on R:
(2) Anyway for security reasons, the default window service account won't be able to access network drives. Hence even if you use the full network location (\\server\etc.) it still won't work.
 
Marshal
Posts: 25811
69
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Duc Vo wrote:(1) In windows, a mapped network drive is per user only -> if you see the network path under R: doesn't mean that the service account running servlet container can see it on R:
(2) Anyway for security reasons, the default window service account won't be able to access network drives. Hence even if you use the full network location (\\server\etc.) it still won't work.



Yes, that's true. And if you need your servlet to have access to a UNC path like \\server\etc, here's what you have to do:

  • Create a user profile which has read/write access to that path (don't use your account, make a new one just for this)
  • Configure the service where the servlet container runs, and have it log in as that user profile
  •  
    Gaurav Chikara
    Ranch Hand
    Posts: 413
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Yes, that's true. And if you need your servlet to have access to a UNC path like \\server\etc, here's what you have to do:

  • Create a user profile which has read/write access to that path (don't use your account, make a new one just for this)
  • Configure the service where the servlet container runs, and have it log in as that user profile


  • Thanks a lot for the reply
    I am not sure how to achive the point 2 suggested. Is there some help around (which you are available that can help me in knowing its details)

     
    Paul Clapham
    Marshal
    Posts: 25811
    69
    Eclipse IDE Firefox Browser MySQL Database
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Open the "Services" tool from the Windows control panel. Right-click the service you want to work with and click "Properties". It's in there somewhere, just look around.
     
    Sheriff
    Posts: 21997
    107
    Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Services is within the Administrative Tools folder inside the control panel. Double click on the service, then go to the Log On tab. Select "This account", then fill in or select the user account and fill in the password twice. Confirm if it asks you to give the user run as service privileges.

    And yes, you'll still need to use \\server\share after that, since shares are only mapped when you login.
     
    no wonder he is so sad, he hasn't seen this tiny ad:
    Thread Boost feature
    https://coderanch.com/t/674455/Thread-Boost-feature
      Bookmark Topic Watch Topic
    • New Topic