From 9c32945c2c8289e3772a41380575ec1a9689255c Mon Sep 17 00:00:00 2001 From: Markus Geiss Date: Tue, 12 May 2015 07:17:17 +0200 Subject: [PATCH] added logging to detect build failure --- .../commands/provider/CommandHandlerProvider.java | 11 ++++++++++- .../portfolio/search/SearchConstants.java | 1 - 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/commands/provider/CommandHandlerProvider.java b/mifosng-provider/src/main/java/org/mifosplatform/commands/provider/CommandHandlerProvider.java index 850e38a81..85a699d65 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/commands/provider/CommandHandlerProvider.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/commands/provider/CommandHandlerProvider.java @@ -11,6 +11,8 @@ import org.apache.commons.lang3.StringUtils; import org.mifosplatform.commands.annotation.CommandType; import org.mifosplatform.commands.exception.UnsupportedCommandException; import org.mifosplatform.commands.handler.NewCommandSourceHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; @@ -36,6 +38,8 @@ import java.util.HashMap; @Scope("singleton") public class CommandHandlerProvider implements ApplicationContextAware { + private static final Logger LOGGER = LoggerFactory.getLogger(CommandHandlerProvider.class); + private ApplicationContext applicationContext; private HashMap registeredHandlers; @@ -70,8 +74,13 @@ public class CommandHandlerProvider implements ApplicationContextAware { final String[] commandHandlerBeans = this.applicationContext.getBeanNamesForAnnotation(CommandType.class); if (ArrayUtils.isNotEmpty(commandHandlerBeans)) { for (final String commandHandlerName : commandHandlerBeans) { + LOGGER.info("Register command handler '" + commandHandlerName + "' ..."); final CommandType commandType = this.applicationContext.getType(commandHandlerName).getAnnotation(CommandType.class); - this.registeredHandlers.put(commandType.entity() + "|" + commandType.action(), commandHandlerName); + try { + this.registeredHandlers.put(commandType.entity() + "|" + commandType.action(), commandHandlerName); + } catch (final Throwable th) { + LOGGER.error("Unable to register command handler '" + commandHandlerName + "'!", th); + } } } } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/search/SearchConstants.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/search/SearchConstants.java index d47566182..fd466b2d2 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/search/SearchConstants.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/search/SearchConstants.java @@ -1,5 +1,4 @@ /** - * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/.