Execution of a shell by a java service failed

Hi all,

I have created a java service that executes a shell (we’re currently running in version 4.0.1). This shell (test.sh) contains this code : echo “toto1” > test.txt
And this is my java service :

java.lang.String cmds = new String[1];
cmds[0] = “/applis/ExchangeFolder/test.sh”;

// execute the command
try
{
Process pr = Runtime.getRuntime().exec(cmds);
}
catch(Exception e)
{
System.out.println("Execution du test "+e.getMessage());
}

When I run it, the audit.log tells me it’s OK but there’s no file test.txt created ! Have I missed something ? Or is there another way to do it ?

Any help is highly appreciated! Thanks,

Phil

Possibly a file creation persmission issue?

You’d probably get a service exception if there were a file permission problem.

Do you know where the file is supposed to be located? Usually when you don’t specify an absolute path the file goes under the webMethods server install directory basepath. Try doing a search for the file.

Will Kriski

You’re right Will, I have found the file under the webMethods server install directory basepath.
But I’m sure it was’nt here at the beginning of my tests.
But there happened an important thing during the afternoon : the jvm has been updated (and nobody told me…). So it’s perhaps the explanation for the change…
Thank you, Rob and Will,

Phil.