use of com.sun.enterprise.universal.xml.MiniXmlParserException in project Payara by payara.
the class GFLauncher method launchInstance.
void launchInstance() throws GFLauncherException, MiniXmlParserException {
if (isFakeLaunch()) {
return;
}
List<String> cmds = null;
// See GLASSFISH-21343
if (OS.isDarwin() && useLaunchCtl(System.getProperty("os.version")) && (!getInfo().isVerboseOrWatchdog())) {
// On MacOS we need to start long running process with
// StartupItemContext. See IT 12942
cmds = new ArrayList<String>();
// cmds.add("/usr/libexec/StartupItemContext");
// In MacOS 10.10 they removed StartupItemContext
// so call launchctl directly doing what StartupItemContext did
// See GLASSFISH-21113
// remove bsexec as from 10.10.3 bsexec requires sudo
cmds.add("nohup");
cmds.addAll(getCommandLine());
} else {
cmds = getCommandLine();
}
ProcessBuilder pb = new ProcessBuilder(cmds);
// default.
try {
File newDir = getInfo().getConfigDir();
pb.directory(newDir);
} catch (Exception e) {
}
// run the process and attach Stream Drainers
try {
closeStandardStreamsMaybe();
process = pb.start();
final String name = getInfo().getDomainName();
// verbose trumps watchdog.
if (getInfo().isVerbose()) {
psd = ProcessStreamDrainer.redirect(name, process);
} else if (getInfo().isWatchdog()) {
psd = ProcessStreamDrainer.dispose(name, process);
} else {
psd = ProcessStreamDrainer.save(name, process);
}
writeSecurityTokens(process);
} catch (Exception e) {
throw new GFLauncherException("jvmfailure", e, e);
}
// if verbose, hang around until the domain stops
if (getInfo().isVerboseOrWatchdog())
wait(process);
}
Aggregations