From 45c0d2d2f5f5ecb3d0144e8a7264209e2d03042b Mon Sep 17 00:00:00 2001 From: ayyoob Date: Sun, 23 Oct 2016 10:51:14 +0530 Subject: [PATCH] added logs if device type registration failed --- .../DeviceManagementServiceComponent.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java index 7e1c95efda9..bc52a5204f3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java @@ -272,15 +272,22 @@ public class DeviceManagementServiceComponent { * @param deviceManagementService An instance of DeviceManagementService */ protected void setDeviceManagementService(DeviceManagementService deviceManagementService) { - if (log.isDebugEnabled()) { - log.debug("Setting Device Management Service Provider: '" + - deviceManagementService.getType() + "'"); - } - synchronized (LOCK) { - deviceManagers.add(deviceManagementService); - for (PluginInitializationListener listener : listeners) { - listener.registerDeviceManagementService(deviceManagementService); + try { + if (log.isDebugEnabled()) { + log.debug("Setting Device Management Service Provider: '" + + deviceManagementService.getType() + "'"); } + synchronized (LOCK) { + deviceManagers.add(deviceManagementService); + for (PluginInitializationListener listener : listeners) { + listener.registerDeviceManagementService(deviceManagementService); + } + } + log.info("Device Type deployed successfully : " + deviceManagementService.getType() + " for tenant " + + deviceManagementService.getProvisioningConfig().getProviderTenantDomain()); + } catch (Throwable e) { + log.error("Failed to register device management service for device type" + deviceManagementService.getType() + + " for tenant " + deviceManagementService.getProvisioningConfig().getProviderTenantDomain(), e); } }