From e0f2dc9bd45012f2ba98287f4a5671713c582751 Mon Sep 17 00:00:00 2001 From: Claus Ibsen Date: Wed, 2 Oct 2013 11:54:53 +0200 Subject: [PATCH] AMQ-4748: Fixed shutting down AMQ standalone does not raise exception. --- .../org/apache/activemq/console/command/StartCommand.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/activemq-console/src/main/java/org/apache/activemq/console/command/StartCommand.java b/activemq-console/src/main/java/org/apache/activemq/console/command/StartCommand.java index e2b5768329..be3ffc3b17 100644 --- a/activemq-console/src/main/java/org/apache/activemq/console/command/StartCommand.java +++ b/activemq-console/src/main/java/org/apache/activemq/console/command/StartCommand.java @@ -116,7 +116,12 @@ public class StartCommand extends AbstractCommand { // The broker has stopped.. shutdownLatch.await(); - Runtime.getRuntime().removeShutdownHook(jvmShutdownHook); + try { + Runtime.getRuntime().removeShutdownHook(jvmShutdownHook); + } catch (Throwable e) { + // may already be shutdown in progress so ignore + } + if( !broker.isRestartRequested() ) { break; }