When the Message Processor gets deactivated due to an issue, it keeps deactivated state even after restarting the server. 
**Description:**
After redeploying a carbon application / restarted the server, the Message Processor goes to a Paused state. 

If the Message Processor gets deactivated due to some issue (as an example, the endpoint not existing), even if the car file is redeployed and the server is restarted, the message processor is in the PAUSED state. 

```
[2020-06-17 17:22:23,953]  INFO {ScheduledMessageProcessor} - Started message processor. [Processor1].
[2020-06-17 17:22:23,953]  INFO {AbstractQuartzTaskManager} - Task paused: [ESB_TASK][MSMP_Processor1_0]
[2020-06-17 17:22:23,954]  INFO {ScheduledMessageProcessor} - Successfully deactivated the message processor [Processor1]
```
In /mi-home/registry/governance/repository/components/org.apache.synapse.message.processor/Processor1.properties file, 
**MESSAGE_PROCESSOR_STATE=PAUSED**

Tested pack: https://wso2.org/jenkins/job/products/job/micro-integrator/lastSuccessfulBuild/artifact/distribution/target/wso2mi-1.2.0-SNAPSHOT.zip

[JMSMessageStoreCompositeApplication_1.0.0.car.zip](https://github.com/wso2/micro-integrator/files/4792291/JMSMessageStoreCompositeApplication_1.0.0.car.zip)

diff --git a/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistry.java b/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistry.java
index 5b85cfa69..14b843a0a 100644
--- a/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistry.java
+++ b/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistry.java
@@ -618,14 +618,19 @@ public class MicroIntegratorRegistry extends AbstractRegistry {
      */
     private void removeResource(String key) {
         try {
-            File resource = new File(new URI(resolveRegistryURI(key)));
+            String resourcePath = resolveRegistryURI(key);
+            File resource = new File(new URI(resourcePath));
             if (resource.exists()) {
                 if (resource.isFile()) {
                     deleteFile(resource);
+                    // the properties also need to be removed when removing the resource
+                    File resourceProperties = new File(new URI(resourcePath + PROPERTY_EXTENTION));
+                    if (resourceProperties.exists()) {
+                        deleteFile(resourceProperties);
+                    }
                 } else if (resource.isDirectory()) {
                     deleteDirectory(resource);
                 }
-
             } else {
                 handleException("Parent folder: " + key + " does not exists.");
             }
['components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistry.java']