Target target = null;
try {
target = TargetBuilder.INSTANCE.createTarget(
VALID_TYPES, serverName, configContext);
} catch (Exception e) {
throw new InstanceException(
_strMgr.getString("noSuchInstance", serverName));
}
NodeAgent controller = target.getNodeAgents()[0];
String agentName = controller.getName();
// Call the Node Agent to start the server instance remotely
NodeAgentsConfigBean ncb = getNodeAgentsConfigBean();
if (ncb.isRunning(agentName)) {
if (isRunning(serverName)) {
// WBN January 2007 Issue 726
// This is now OFFICIALLY not an error. Log it and return
StringManagerBase sm = StringManagerBase.getStringManager(
getLogger().getResourceBundleName());
getLogger().log(Level.WARNING,
sm.getString("eeadmin.already.running", serverName));
return;
} else {
String installRoot = System.getProperty(
SystemPropertyConstants.INSTALL_ROOT_PROPERTY);
String instanceRoot = System.getProperty(
SystemPropertyConstants.INSTANCE_ROOT_PROPERTY);
NodeAgentMBean agentMBean = NodeAgentProxy.getNodeAgentProxy(agentName);
agentMBean.startInstance(serverName, props);
}
} else {
throw new InstanceException(_strMgr.getString("agentNotRunning",
agentName, serverName));
}
} catch (Exception ex) {
throw getExceptionHandler().handleInstanceException(
ex, "eeadmin.startServerInstance.Exception", serverName);