log.error("Unable to create output for: " + nodeName);
log.error("Unable to create output for: " + nodeName, e);
  private void prepareToCreateNodes() {    // first need to set configuration file name property in ALL nodes    // as these are all used by each experiment configuration writer    for (int i = 0; i < nodesToRun.length; i++) {      NodeComponent nodeComponent = nodesToRun[i];      nodeComponent.addProperty("ConfigurationFileName",                                nodeComponent.getShortName() + currentTrial);    }    for (int i = 0; i < nodesToRun.length; i++) {      NodeComponent nodeComponent = nodesToRun[i];      String hostName = hostsToRunOn[i];      final String nodeName = nodeComponent.getShortName();      // create an unique node name to circumvent server problems      String uniqueNodeName = nodeName;      // get arguments from NodeComponent and pass them to ApplicationServer      // note that these properties augment any properties that      // are passed to the server in a properties file on startup      Properties properties = getNodeMinusD(nodeComponent);      String[] args = getNodeArguments(nodeComponent);      properties.setProperty("org.cougaar.experiment.id",                              experiment.getTrialID());      //Don't override if it's already set      if (properties.getProperty("org.cougaar.core.persistence.clear")           == null) {        properties.setProperty("org.cougaar.core.persistence.clear",                               "true");      }      // create a status button      NodeStatusButton statusButton = createStatusButton(nodeName, hostName);      ConsoleStyledDocument doc = new ConsoleStyledDocument();      ConsoleTextPane textPane = new ConsoleTextPane(doc, statusButton);      JScrollPane scrollPane = new JScrollPane(textPane);      // create a node event listener to get events from the node      NodeEventListener listener;      String logFileName = getLogFileName(nodeName);      try {        listener = new ConsoleNodeListener(this,                                           nodeComponent,                                           logFileName,                                           statusButton,                                           doc);      } catch (Exception e) {        if(log.isErrorEnabled()) {          log.error("Unable to create output for: " + nodeName);        }        continue;      }      if (notifyCondition != null)        textPane.setNotifyCondition(notifyCondition);      ((ConsoleStyledDocument)textPane.getStyledDocument()).setBufferSize(viewSize);      if (notifyOnStandardError)        statusButton.setNotifyOnStandardError(true);      if (displayFilter != null)        ((ConsoleNodeListener)listener).setFilter(displayFilter);      nodeListeners.put(nodeName, listener);      nodePanes.put(nodeName, textPane);      NodeEventFilter filter = new NodeEventFilter(10);//       ConfigurationWriter configWriter = //         experiment.getConfigurationWriter(nodesToRun);      Iterator fileIter = experiment.getConfigFiles(nodesToRun);      HostServesClient hsc = null;      try {        hsc = communitySupport.getHost(hostName, getAppServerPort(properties));      } catch (Exception e) {        if(log.isErrorEnabled()) {          log.error("CSMARTConsole: cannot create node: " + nodeName);        }        JOptionPane.showMessageDialog(this,                                      "Cannot create node on: " + hostName +                                      "; check that server is running");        continue;      }      while(fileIter.hasNext()) {        String filename = (String)fileIter.next();        OutputStream out = null;        try {          out = hsc.write(filename);          experiment.writeContents(filename, out);        } catch(Exception e) {          if(log.isErrorEnabled()) {            log.error("Caught an Exception writing leaf", e);          }        } finally {          try {            out.close();          } catch(Exception e) {            if(log.isErrorEnabled()) {              log.error("Caught exception closing stream", e);            }          }        }      }      NodeCreationInfo nci =        new NodeCreationInfo(hsc, uniqueNodeName, properties, args,                             listener, filter,                              nodeName, hostName,                             nodeComponent, scrollPane, statusButton,                             logFileName);      nodeCreationInfoList.add(nci);    }  }