Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problem executing external exe from Tomcat when running as service

Thread Tools

Problem executing external exe from Tomcat when running as service

Posts: n/a

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.

Reply With Quote
Eki Y. Baskoro
Posts: n/a

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.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems executing external application (.exe) using Windows service gaurav tyagi ASP .Net 1 06-19-2006 04:07 PM
Tomcat question - running tomcat webapp from root Sean Berry Java 3 12-19-2005 07:19 PM
Problem with Tomcat Service when Tomcat Installation pathname has double byte characters Rakesh Pandit Java 0 07-12-2005 06:25 AM
Calling a Web Service using Axis, from within an Axis Web Service running under Tomcat hocho888 Java 1 04-29-2005 08:26 PM
Web Application/Service for executing long running tasks BK ASP .Net 15 06-14-2004 03:44 PM