Skip to content

Commit

Permalink
Writing error stream of new VM to file for improved debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
schuemie committed Mar 14, 2019
1 parent 7a9ecc9 commit ec1d1fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/org/ohdsi/utilities/RabbitInAHatLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.ohdsi.rabbitInAHat.RabbitInAHatMain;

import java.util.Arrays;
import java.io.File;
import java.util.ArrayList;

/* Adapted from code found on:
Expand All @@ -25,6 +26,8 @@ public static void main(String[] args) throws Exception {
command.addAll(Arrays.asList("java", "-Xmx" + MIN_HEAP + "m", "-classpath", pathToJar, "org.ohdsi.rabbitInAHat.RabbitInAHatMain"));
command.addAll(Arrays.asList(args));
ProcessBuilder pb = new ProcessBuilder(command);
pb.inheritIO();
pb.redirectError(new File("ErrorStream.txt"));
pb.start();
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/org/ohdsi/utilities/WhiteRabbitLauncher.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.ohdsi.utilities;

import java.io.File;

import org.ohdsi.whiteRabbit.WhiteRabbitMain;

/* Adapted from code found on:
Expand All @@ -19,6 +21,8 @@ public static void main(String[] args) throws Exception {
System.out.println("Starting new VM");
String pathToJar = WhiteRabbitMain.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
ProcessBuilder pb = new ProcessBuilder("java", "-Xmx" + MIN_HEAP + "m", "-classpath", pathToJar, "org.ohdsi.whiteRabbit.WhiteRabbitMain");
pb.inheritIO();
pb.redirectError(new File("ErrorStream.txt"));
pb.start();
}
}
Expand Down

0 comments on commit ec1d1fa

Please sign in to comment.