diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java index 63508c3f06..627ea432a9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java @@ -23,6 +23,7 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceStatusTaskPluginConfig; +import org.wso2.carbon.device.mgt.common.InvalidConfigurationException; import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig; import org.wso2.carbon.device.mgt.common.ProvisioningConfig; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager; @@ -167,9 +168,13 @@ public class DeviceManagementPluginRepository implements DeviceManagerStartupLis } } if (operationManager != null) { - NotificationStrategy notificationStrategy = operationManager.getNotificationStrategy(); - if (notificationStrategy != null) { - notificationStrategy.undeploy(); + try { + NotificationStrategy notificationStrategy = operationManager.getNotificationStrategy(); + if (notificationStrategy != null) { + notificationStrategy.undeploy(); + } + } catch (InvalidConfigurationException ignore) { + //error occurred while undeploying strategy, ignore error } operationManagerRepository.removeOperationManager(deviceTypeIdentifier); }