Problem executing external exe from Tomcat when running as service

S

Stan

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.
 
E

Eki Y. Baskoro

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top