diff --git a/components/registry/org.wso2.carbon.registry.task/src/main/java/org/wso2/carbon/registry/task/internal/RegistryTaskServiceComponent.java b/components/registry/org.wso2.carbon.registry.task/src/main/java/org/wso2/carbon/registry/task/internal/RegistryTaskServiceComponent.java index 9fb8de4ea..275464c39 100644 --- a/components/registry/org.wso2.carbon.registry.task/src/main/java/org/wso2/carbon/registry/task/internal/RegistryTaskServiceComponent.java +++ b/components/registry/org.wso2.carbon.registry.task/src/main/java/org/wso2/carbon/registry/task/internal/RegistryTaskServiceComponent.java @@ -100,6 +100,13 @@ protected void setTaskService(TaskService taskService) { } private void registerTasks(TaskManager taskManager) throws TaskException { + try { + for (TaskInfo taskInfo : taskManager.getAllTasks()) { + taskManager.deleteTask(taskInfo.getName()); + } + } catch (TaskException ignore){ + + } String configPath = CarbonUtils.getRegistryXMLPath(); if (configPath != null) { File registryXML = new File(configPath);