summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java
index 60fa42d..b96a2cc 100644
--- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java
+++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java
@@ -402,9 +402,11 @@ public class ApplicationServerOperationsDelegate {
ProcessExecutionResults results = systemInfo.executeProcess(processExecution);
logExecutionResults(results);
- if (results.getError() != null) {
- throw new ExecutionFailedException("Error executing shutdown script while stopping AS instance. Exit code ["
- + results.getExitCode() + "]: " + results.getError().getMessage(), results.getError());
+ if (results.getError() != null || results.getExitCode() != 0) {
+ throw new ExecutionFailedException(
+ "Error executing shutdown script while stopping AS instance. Shutdown script returned exit code ["
+ + results.getExitCode() + "]"
+ + (results.getError() != null ? ": " + results.getError().getMessage() : ""), results.getError());
}
return "The server has been shut down.";