Skip to content

Commit

Permalink
fix for CNFE of EJB Vehicle classes
Browse files Browse the repository at this point in the history
Signed-off-by: Gurunandan Rao <[email protected]>
  • Loading branch information
gurunrao committed Sep 28, 2024
1 parent 03248ae commit ea4ce72
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ public synchronized void quit() throws Exception {
* @throws Exception - on failure
*/
public void run(String vehicleArchiveName, String clientAppArchive, String... additionalArgs) throws Exception {

ArrayList<String> cmdList = new ArrayList<String>();


// Need to replace any property refs on command line
File earDir = new File(clientEarDir);
if(earDir.isAbsolute()) {
Expand All @@ -133,14 +137,22 @@ public void run(String vehicleArchiveName, String clientAppArchive, String... ad
}

}

for (int n = 0; n < cmdLine.length; n ++) {
String arg = cmdLine[n];
cmdList.addAll(Arrays.asList(cmdLine[n].split(" ")));
}

if (additionalArgs != null) {
String[] newCmdLine = new String[cmdLine.length + additionalArgs.length];
System.arraycopy(cmdLine, 0, newCmdLine, 0, cmdLine.length);
System.arraycopy(additionalArgs, 0, newCmdLine, cmdLine.length, additionalArgs.length);
cmdLine = newCmdLine;
cmdList.addAll(Arrays.asList(additionalArgs));

}

appClientProcess = Runtime.getRuntime().exec(cmdLine, clientEnvp, clientDir);
appClientProcess = Runtime.getRuntime().exec(cmdList.toArray(new String[0]), clientEnvp, clientDir);
onExit = appClientProcess.onExit();
LOGGER.info("Created process" + appClientProcess.info());
LOGGER.info("process(%d).envp: %s".formatted(appClientProcess.pid(), Arrays.toString(clientEnvp)));
Expand Down

0 comments on commit ea4ce72

Please sign in to comment.