title: Tomcat windows service unable to access network drive
body: <p>I have two windows domains A and B.</p>
  
  <p>I have two servers: <code>nasB</code> on domain B, and <code>webserverA</code> on domain A.</p>
  
  <p>I have two users: <code>userB</code> on domain B and access to <code>nasB</code> and <code>userA</code> on domain A with access to <code>webserverA</code></p>
  
  <p>I am running tomcat as a service on <code>webserverA</code> and it has the logon as property set to <code>userA</code>.</p>
  
  <p>I have <code>\\nasB\myFiles$\</code> mapped on <code>webserverA</code> using <code>userB</code> credentials.  The mapping is only to allow the JVM access.  I always access the drive using UNC in the code.  I also have credentials in the manage network passwords.  Both methods work when running any java app directly but not as a service :(</p>
  
  <p>If I run tomcat as a service it throws a filenotfound except when trying to access <code>\\nasB\myFiles$\somefile.txt</code>.  If I run tomcat using the startup.bat it can access the file fine.</p>
  
  <p>I cannot run tomcat service using <code>userB</code> as he does not have access to <code>webserverA</code>.  How do I let my tomcat service use the <code>userB</code> credentials when accessing <code>nasB</code>? </p>