Execute 0r Call Perl from within Java

Discussion in 'Java' started by lord0, Apr 7, 2004.

  1. lord0

    lord0 Guest

    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
    lord0, Apr 7, 2004
    #1
    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. Savas Ates
    Replies:
    1
    Views:
    276
    Patrice
    Aug 17, 2004
  2. bruno

    Execute JavaScript from within Perl

    bruno, Nov 6, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    97
    Malcolm Dew-Jones
    Nov 6, 2003
  3. Jon
    Replies:
    1
    Views:
    106
    Chris
    Jan 3, 2004
  4. Petterson Mikael

    Execute another perl script from my perl script

    Petterson Mikael, Jan 5, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    137
    Paul Lalli
    Jan 5, 2005
  5. jeanwelly

    A perl issue when execute system call

    jeanwelly, Jul 19, 2007, in forum: Perl Misc
    Replies:
    7
    Views:
    149
Loading...

Share This Page