Hi,
PFB the java code. However I do not feel the issue is with java code. The same code was tried in eclipse, and the script was run without any issue.
Process child = Runtime.getRuntime().exec(command);
// read stdout; required to keep this process from becoming a zombie
InputStream stdout = child.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(stdout));
int siz = 1024;
char[] buff = new char[siz];
int r = 0;
StringBuffer sbf = new StringBuffer();
while ( ( r = reader.read(buff, 0, siz) ) > 0 )
{
sbf.append(buff, 0, r);
}
stdoutText = sbf.toString();
// read stderr; required to keep this process from becoming a zombie
InputStream stderr = child.getErrorStream();
reader = new BufferedReader(new InputStreamReader(stderr));
StringBuffer sbf2 = new StringBuffer();
while ( ( r = reader.read(buff, 0, siz) ) > 0 )
{
sbf2.append(buff, 0, r);
}
stderrText = sbf2.toString();
child.waitFor(); // IllegalThreadStateException, if w/o wait & child not terminated
status = child.exitValue();
#webMethods#Integration-Server-and-ESB#webMethods-General