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

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

    Execute perl in java

    Tim, Dec 13, 2003, in forum: Java
    Replies:
    5
    Views:
    30,536
    kmonsoor
    Feb 10, 2011
  2. crazykiller

    Execute perl in Java

    crazykiller, Jun 30, 2010, in forum: Java
    Replies:
    0
    Views:
    747
    crazykiller
    Jun 30, 2010
  3. Savas Ates
    Replies:
    1
    Views:
    454
    Patrice
    Aug 17, 2004
  4. bruno

    Execute JavaScript from within Perl

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

    Execute another perl script from my perl script

    Petterson Mikael, Jan 5, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    282
    Paul Lalli
    Jan 5, 2005
  7. Replies:
    20
    Views:
    1,320
    Gunnar Hjalmarsson
    Jan 18, 2005
  8. jeanwelly

    A perl issue when execute system call

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