cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Running commands from JAVA and ACL?

ptc-953343
1-Visitor

Running commands from JAVA and ACL?

I'm having troubles with running a command (basically an Ant script) from
Java within Arbortext. Here is the code:

public static void build() {

String s = null;

try {

String[] commands = new String[]{ "C:\\Program
Files\\nsiv3.1.15.2\\bin\\makedoc.bat", "IETP"};

Process p = Runtime.getRuntime().exec(commands);

BufferedReader stdInput = new BufferedReader(new
InputStreamReader(p.getInputStream()));
BufferedReader stdError = new BufferedReader(new
InputStreamReader(p.getErrorStream()));

// read the output from the command

System.out.println("BUILDing:\n");
System.out.println("Here is the standard output of the
command:\n");
while ((s = stdInput.readLine()) != null) {
System.out.println(s);
}

// read any errors from the attempted command

System.out.println("Here is the standard error of the command
(if any):\n");
//while ((s = stdError.readLine()) != null) {
// System.out.println(s);
//}
}
catch (IOException e) {
System.out.println("exception happened - here's what I know: ");
e.printStackTrace();
System.exit(-1);
}

}

And I run this with either java_static() or java_static_modal() with about
the same results. the basic makedoc deploy command runs a multistep build
process. Thsi scripts runs to about 99% complete and then just hangs. At
the point it seems to stop (or at least the output I get in the console
window) is that it is zipping the files together that were built. The last
step is to then "deploy" the files to another location on my local
machine.

I'd sware that this code worked a couple of times last week when I asked
about setting the working directory consistently. I'm now working in the
right location, but now things just stop.

When I look at an run the files that were built it looks like everything
completed. Am I getting some weird interaction between the two operations?

Here is my calling sequence from the ACL

java_static('NSIVbuild', 'genBuildProps');
java_static('NSIVbuild', 'genPubModule', $selection)

java_static('NSIVbuild', 'remove');

response("Starting build, this takes a minute or two")
# Build works if the directory is set properly, but the cd commands
# are having problems above
java_static('NSIVbuild', 'build');

response("Completed, now launching NSIV")
java_static('NSIVbuild', 'display');


I get into the java_static('NSIVbuild', 'build'); but I never get the
response window after that.

..dan
0 REPLIES 0
Announcements

Top Tags