Problem executing external exe from Tomcat when running as service

Discussion in 'Java' started by Stan, Dec 16, 2003.

  1. Stan

    Stan Guest

    Hi,

    I have an .exe which I am trying to run from a Servlet under Tomcat
    using Runtime.exe(). The exe reads a file (currently mounted as a
    network drive \\mynetworkedHost\directoryA) and writes a file to a
    directory under Program files which is world writable.

    When Tomcat is started as a user from a cmd shell the process executes
    properly. When Tomcat is running as a service the process fails to run
    without any useful feedback as to why.

    Interestingly when running as a service I can run the command without
    any arguements and it completes with a 0 exit code. It's only when I
    give it args and it needs to process (read a file) and write output
    that the exe fails when run under the tomcat service. This is on
    Windows XP Sp1, java 1.3.1_09 and tomcat 4.1.

    Things do work when the file it is reading is located locally on the
    c: drive.

    This appears to be a windows permissions issue with accessing a
    networked drive. All works well if the Tomcat service is running as
    Administrator and the local Administrator has the same password as the
    remotely mounted file systems Administrator password. So this probably
    isn't a Java/Tomcat specific issue but I thought I'd post this here
    incase anyone else has seen it.

    Thanks.
     
    Stan, Dec 16, 2003
    #1
    1. Advertising

  2. G'Day,

    This is due to the security restriction under NTFS file system in Windows
    XP. The best way is to copy the executable script to your C: drive.
     
    Eki Y. Baskoro, Dec 18, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BK
    Replies:
    15
    Views:
    730
    Alvin Bruney [MVP]
    Jun 14, 2004
  2. hocho888
    Replies:
    1
    Views:
    661
  3. Rakesh Pandit
    Replies:
    0
    Views:
    511
    Rakesh Pandit
    Jul 12, 2005
  4. gaurav tyagi
    Replies:
    1
    Views:
    770
    bruce barker \(sqlwork.com\)
    Jun 19, 2006
  5. Chaos
    Replies:
    1
    Views:
    423
Loading...

Share This Page