ARTEMIS-322 fix spurious exception
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/aeafc6a9 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/aeafc6a9 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/aeafc6a9 Branch: refs/heads/master Commit: aeafc6a974230c4850bea78e863790061e5a6521 Parents: 5dc5a24 Author: jbertram <[email protected]> Authored: Mon Jun 27 14:25:14 2016 -0500 Committer: jbertram <[email protected]> Committed: Mon Jun 27 14:25:51 2016 -0500 ---------------------------------------------------------------------- .../artemis/jms/server/impl/JMSServerManagerImpl.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aeafc6a9/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java ---------------------------------------------------------------------- diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java index 336c9d2..228c1bd 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java @@ -1719,7 +1719,18 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString()); if (address.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX) && settings.isAutoDeleteJmsTopics() && bindings.size() == 1 && queue != null && queue.isAutoCreated()) { - destroyTopic(address.toString().substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length())); + try { + destroyTopic(address.toString().substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length())); + } + catch (IllegalStateException e) { + /* + * During shutdown the callback can be invoked after the JMSServerManager is already shut down so we just + * ignore the exception in that case + */ + if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled()) { + ActiveMQJMSServerLogger.LOGGER.debug("Failed to destroy topic", e); + } + } } } }
