Index: src/main/java/com/sun/enterprise/admin/cli/cluster/DeleteLocalInstanceCommand.java =================================================================== --- src/main/java/com/sun/enterprise/admin/cli/cluster/DeleteLocalInstanceCommand.java (revision 42904) +++ src/main/java/com/sun/enterprise/admin/cli/cluster/DeleteLocalInstanceCommand.java (working copy) @@ -145,23 +145,24 @@ * Ask DAS to wipe it out from domain.xml */ private void doRemote() throws CommandException { - try { + if (isDASRunning()) { RemoteCommand rc = new RemoteCommand("_unregister-instance", programOpts, env); rc.execute("_unregister-instance", "--node", getServerDirs().getServerParentDir().getName(), - //"--remote_only", "true", getServerDirs().getServerName()); + } else { + String newString = Strings.get("DeleteInstance.remoteError", + programOpts.getHost(), "" + programOpts.getPort()); + throw new CommandException(newString); } - catch (CommandException ce) { - // Let's add our $0.02 to this Exception! - Throwable t = ce.getCause(); - String newString = Strings.get("DeleteInstance.remoteError", - ce.getLocalizedMessage()); + } - if (t != null) - throw new CommandException(newString, t); - else - throw new CommandException(newString); + private boolean isDASRunning() { + try { + getUptime(); + return true; + } catch (CommandException ex) { + return false; } } } Index: src/main/java/com/sun/enterprise/admin/cli/cluster/LocalStrings.properties =================================================================== --- src/main/java/com/sun/enterprise/admin/cli/cluster/LocalStrings.properties (revision 42904) +++ src/main/java/com/sun/enterprise/admin/cli/cluster/LocalStrings.properties (working copy) @@ -115,10 +115,7 @@ DeleteInstance.badWhack=Unable to delete the instance directory: {0} The directory still exists after trying to delete it. DeleteInstance.badWhackWithException=Unable to delete the instance directory: {0}. \n\ This IOException was thrown: {1) \n** STACK TRACE **\n{2} -DeleteInstance.remoteError=The DAS command to remove the instance from the configuration failed. \ -The entire operation has been rolled back. \nRun the command again after solving the problem with \ -the Domain Administration Server. \nOr run this command again with the filesystemonly argument set to true and the \ -local files will be deleted only. \nBelow is the original message from CLI and/or DAS:\n\n{0} +DeleteInstance.remoteError=Failed to connect to DAS on {0}:{1}. DeleteInstance.noWhack=The instance directory does not exist: {0} DeleteInstance.noInstance=The instance does not exist on this machine. Config.badConfigNames=You must specify a source and destination config