Execute 0r Call Perl from within Java

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
 

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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top