Unable to run shell script from Java thru Websphere

Discussion in 'Java' started by javadev_helpseeker, Feb 7, 2009.

  1. javadev_helpseeker

    javadev_helpseeker

    Joined:
    Feb 7, 2009
    Messages:
    1
    Hi,
    I am struggling to run a shell script from Java thru websphere. The script is running well from the Shell prompt but throwing an error (Process killed-exit value 137) when running form Java.
    With in the shell script I am setting the environment for an executable and making the executable run .
    I am placing the script and also the JSP to run the script below:

    <% try
    {
    String permString = "chmod 777 /home/wsphere/mobius/PWD_FILES/win_ABC1.sh";
    Process p = Runtime.getRuntime().exec(permString);
    p.waitFor();
    Process process = Runtime.getRuntime().exec("/home/wsphere/mobius/PWD_FILES/win_ABC1.sh"); //I tried adding "bin/bash -c" before .sh file here
    process.waitFor();
    ........
    .....

    Shell (ksh) script:

    export ORACLE_HOME=/u01/app/oracle/product/10.2.0.1
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    ....
    ....
    echo before executing VDR

    /home/wsphere/mobius/VDRDBXML/bin/vdrdbxml -F /home/wsphere/mobius/PWD_FILES/WIN/WIN_ABC1.txt -DSN ISMX -U BML -P BML -DSU mob -DSP mob -X -LOG /home/wsphere/mobius/PWD_FILES/WIN/WIN_ABC1.log -nex
    #end of file
    ....


    All the environment was set correctly..Iam able to get the message "Before executing VDR", but while executing the executable I am receiving signal 9 from AIX.

    The environment in jdk 1.4.2, websphere 6.1 Kshell and AIX 5.3. This shell script is running fine at command prompt.

    The user is having all permissions & authorized to run the script.

    Please advice...Thanks in advance
    javadev_helpseeker, Feb 7, 2009
    #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. clinton__bill@hotmail.com

    can I run unix shell command in the ModelSim shell?

    clinton__bill@hotmail.com, Feb 18, 2005, in forum: VHDL
    Replies:
    2
    Views:
    5,653
    Jonathan Bromley
    Feb 18, 2005
  2. Christian Heimes
    Replies:
    0
    Views:
    583
    Christian Heimes
    Feb 27, 2008
  3. THTB
    Replies:
    0
    Views:
    173
  4. Max Williams
    Replies:
    3
    Views:
    155
    Robert Klemme
    Jan 6, 2009
  5. moongeegee

    execute a shell script in a shell script

    moongeegee, Dec 3, 2007, in forum: Perl Misc
    Replies:
    2
    Views:
    236
    Ben Morrow
    Dec 4, 2007
Loading...

Share This Page