L
lord0
Hi there,
I'm trying to get a servlet to execute a perl script without success. The
servlet works okay as does the perl but combining the two seems to be the
problem. I'm using com.oreilly.servlet.MultipartRequest for uploading the
original fullsize pics.
In the servlet:
<snip>
Runtime r=Runtime.getRuntime();
String script="/home/scripts/thumb.pl";
r.exec (script);
</snip>
I don't attempt to capture the output from the perl script as all it does is
create thumbnails of images in a given directory, it returns no response.
I'm running on a RH9 box and have "chmoded" all relevant dirs and files to
777! so I'm pretty sure it's not a permissions problem.
Looking in the Tomcat error log I see:
<log>
2004-04-07 12:43:36 StandardWrapperValve[HomePage]: Servlet.service() for
servlet HomePage threw exception
java.lang.IllegalStateException: Cannot forward after response has been
committed
</log>
Which kinda looks to me like the servlet went away to execute the perl but
never came back :-(
Any ideas? I've had a look around and I can't see anything immediately wrong
with the Runtime approach
Cheers
Lord0
I'm trying to get a servlet to execute a perl script without success. The
servlet works okay as does the perl but combining the two seems to be the
problem. I'm using com.oreilly.servlet.MultipartRequest for uploading the
original fullsize pics.
In the servlet:
<snip>
Runtime r=Runtime.getRuntime();
String script="/home/scripts/thumb.pl";
r.exec (script);
</snip>
I don't attempt to capture the output from the perl script as all it does is
create thumbnails of images in a given directory, it returns no response.
I'm running on a RH9 box and have "chmoded" all relevant dirs and files to
777! so I'm pretty sure it's not a permissions problem.
Looking in the Tomcat error log I see:
<log>
2004-04-07 12:43:36 StandardWrapperValve[HomePage]: Servlet.service() for
servlet HomePage threw exception
java.lang.IllegalStateException: Cannot forward after response has been
committed
</log>
Which kinda looks to me like the servlet went away to execute the perl but
never came back :-(
Any ideas? I've had a look around and I can't see anything immediately wrong
with the Runtime approach
Cheers
Lord0