diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
index 14d83b3..35008b6 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
@@ -84,7 +84,7 @@
             try {
                 logger.debug("Vserver to Audit: {}", objectMapper.getMapper().writeValueAsString(vserver));
             } catch (JsonProcessingException e) {
-                logger.error("Json parse exception: {}", e.getMessage());
+                logger.error("Json parse exception: ", e);
             }
 
         });
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
index afc227f..013c7f8 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
@@ -91,6 +91,7 @@
     private static final String CREATE_NETWORK_CONTEXT = "CreateNetwork";
     private static final String NEUTRON_MODE = "NEUTRON";
     private static final String CLOUD_OWNER = "CloudOwner";
+    private static final String LOG_DEBUG_MSG = "Got Network definition from Catalog: {}";
 
     private static final Logger logger = LoggerFactory.getLogger(MsoNetworkAdapterImpl.class);
 
@@ -292,7 +293,7 @@
                 throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
             }
 
-            logger.debug("Got HEAT Template from DB: {}", heatTemplate.toString());
+            logger.debug("Got HEAT Template from DB: {}", heatTemplate);
 
             // "Fix" the template if it has CR/LF (getting this from Oracle)
             String template = heatTemplate.getHeatTemplate();
@@ -656,7 +657,7 @@
                 throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
             }
 
-            logger.debug("Got HEAT Template from DB: {}", heatTemplate.toString());
+            logger.debug("Got HEAT Template from DB: {}", heatTemplate);
 
             // "Fix" the template if it has CR/LF (getting this from Oracle)
             String template = heatTemplate.getHeatTemplate();
@@ -798,12 +799,11 @@
             }
         }
         if (networkCust != null) {
-            logger.debug("Got Network Customization definition from Catalog: {}", networkCust.toString());
+            logger.debug("Got Network Customization definition from Catalog: {}", networkCust);
 
             networkResource = networkCust.getNetworkResource();
         } else if (collectionNetworkCust != null) {
-            logger.debug("Retrieved Collection Network Resource Customization from Catalog: {}",
-                    collectionNetworkCust.toString());
+            logger.debug("Retrieved Collection Network Resource Customization from Catalog: {}", collectionNetworkCust);
             networkResource = collectionNetworkCust.getNetworkResource();
         }
         if (networkResource == null) {
@@ -814,7 +814,7 @@
 
             throw new NetworkException(error, MsoExceptionCategory.USERDATA);
         }
-        logger.debug("Got Network definition from Catalog: {}", networkResource.toString());
+        logger.debug(LOG_DEBUG_MSG, networkResource);
 
         String mode = networkResource.getOrchestrationMode();
         NetworkType neutronNetworkType = NetworkType.valueOf(networkResource.getNeutronNetworkType());
@@ -1045,7 +1045,7 @@
         }
         String mode = "";
         if (networkResource != null) {
-            logger.debug("Got Network definition from Catalog: {}", networkResource.toString());
+            logger.debug(LOG_DEBUG_MSG, networkResource);
 
             mode = networkResource.getOrchestrationMode();
         }
@@ -1132,7 +1132,7 @@
         String mode = "";
         if (networkResource != null) {
 
-            logger.debug("Got Network definition from Catalog: {}", networkResource.toString());
+            logger.debug(LOG_DEBUG_MSG, networkResource);
 
             mode = networkResource.getOrchestrationMode();
         }
@@ -1388,9 +1388,9 @@
         // Resource Property
         List<ContrailSubnet> cslist = new ArrayList<>();
         for (Subnet subnet : subnets) {
-            logger.debug("Input Subnet:{}", subnet.toString());
+            logger.debug("Input Subnet:{}", subnet);
             ContrailSubnet cs = new ContrailSubnetMapper(subnet).map();
-            logger.debug("Contrail Subnet:{}", cs.toString());
+            logger.debug("Contrail Subnet:{}", cs);
             cslist.add(cs);
         }
 
@@ -1523,18 +1523,17 @@
             JsonNode rootNode = mapper.readTree(jStr);
             if (rootNode != null) {
                 for (JsonNode sNode : rootNode.path("ipam_subnets")) {
-                    logger.debug("Output Subnet Node {}", sNode.toString());
+                    logger.debug("Output Subnet Node {}", sNode);
                     String name = sNode.path("subnet_name").textValue();
                     String uuid = sNode.path("subnet_uuid").textValue();
                     String aaiId = name; // default
                     // try to find aaiId for name in input subnetList
                     if (subnets != null) {
                         for (Subnet subnet : subnets) {
-                            if (subnet != null && !commonUtils.isNullOrEmpty(subnet.getSubnetName())) {
-                                if (subnet.getSubnetName().equals(name)) {
-                                    aaiId = subnet.getSubnetId();
-                                    break;
-                                }
+                            if (subnet != null && !commonUtils.isNullOrEmpty(subnet.getSubnetName())
+                                    && subnet.getSubnetName().equals(name)) {
+                                aaiId = subnet.getSubnetId();
+                                break;
                             }
                         }
                     }
@@ -1549,7 +1548,7 @@
                     ErrorCode.DataError.getValue(), e);
         }
 
-        logger.debug("Return sMap {}", sMap.toString());
+        logger.debug("Return sMap {}", sMap);
         return sMap;
     }
 
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
index 0fc94c8..7f1c196 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
@@ -20,6 +20,8 @@
 
 package org.onap.so.asdc.activity;
 
+import java.net.HttpURLConnection;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 import org.onap.so.logger.LoggingAnchor;
@@ -27,6 +29,7 @@
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
+import org.apache.http.HttpStatus;
 import org.onap.so.asdc.activity.beans.ActivitySpec;
 import org.onap.so.asdc.activity.beans.Input;
 import org.onap.so.asdc.activity.beans.Output;
@@ -59,6 +62,11 @@
         String hostname = env.getProperty(SDC_ENDPOINT);
         logger.debug("{} {}", "SDC ActivitySpec endpoint: ", hostname);
         if (hostname == null || hostname.isEmpty()) {
+            logger.warn("The hostname for SDC activities deployment is not configured in SO");
+            return;
+        }
+        if (!checkHttpOk(hostname)) {
+            logger.warn("The sdc end point is not alive");
             return;
         }
         List<org.onap.so.db.catalog.beans.ActivitySpec> activitySpecsFromCatalog = activitySpecRepository.findAll();
@@ -135,4 +143,22 @@
         activitySpec.setOutputs(outputs);
         return;
     }
+
+    public boolean checkHttpOk(String host) {
+        URL url = null;
+        boolean isOk = false;
+
+        int responseCode = 0;
+        try {
+            url = new URL(host);
+            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+            responseCode = connection.getResponseCode();
+        } catch (Exception e) {
+            logger.warn("Exception on connecting to SDC WFD endpoint: " + e.getMessage());
+        }
+        if (responseCode == HttpStatus.SC_OK) {
+            isOk = true;
+        }
+        return isOk;
+    }
 }
diff --git a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java
index 81977da..b41fbaf 100644
--- a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java
+++ b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java
@@ -22,7 +22,10 @@
 import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
 import static com.github.tomakehurst.wiremock.client.WireMock.post;
 import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.putRequestedFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
 import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching;
+import static com.github.tomakehurst.wiremock.client.WireMock.verify;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.when;
 import org.junit.Test;
@@ -73,4 +76,32 @@
         deployActivitySpecs.deployActivities();
         assertTrue(activitySpecCreateResponse.getId().equals("testActivityId"));
     }
+
+    @Test
+    public void deployActivitySpecsIT_SDCEndpointDown_Test() throws Exception {
+        ActivitySpecCreateResponse activitySpecCreateResponse = new ActivitySpecCreateResponse();
+        activitySpecCreateResponse.setId("testActivityId");
+        HttpHeaders headers = new HttpHeaders();
+        headers.set("Accept", MediaType.APPLICATION_JSON);
+        headers.set("Content-Type", MediaType.APPLICATION_JSON);
+
+        ObjectMapper mapper = new ObjectMapper();
+        String body = mapper.writeValueAsString(activitySpecCreateResponse);
+
+        wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec"))
+                .willReturn(aResponse().withHeader("Content-Type", "application/json")
+                        .withStatus(org.springframework.http.HttpStatus.OK.value()).withBody(body)));
+
+        when(env.getProperty("mso.asdc.config.activity.endpoint")).thenReturn("http://localhost:8090");
+
+        String urlPath = "/v1.0/activity-spec/testActivityId/versions/latest/actions";
+
+        wireMockServer.stubFor(
+                put(urlPathMatching(urlPath)).willReturn(aResponse().withHeader("Content-Type", "application/json")
+                        .withStatus(org.springframework.http.HttpStatus.OK.value())));
+
+        deployActivitySpecs.deployActivities();
+        verify(0, putRequestedFor(urlEqualTo(urlPath)));
+    }
+
 }
diff --git a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java
index aae5e5d..7a876a6 100644
--- a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java
+++ b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java
@@ -30,6 +30,7 @@
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.Mockito;
+import org.mockito.Spy;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.onap.so.asdc.activity.ActivitySpecsActions;
 import org.onap.so.asdc.activity.DeployActivitySpecs;
@@ -54,6 +55,7 @@
     protected ActivitySpecsActions activitySpecsActions;
 
     @InjectMocks
+    @Spy
     private DeployActivitySpecs deployActivitySpecs;
 
     @Test
@@ -68,7 +70,8 @@
         List<org.onap.so.db.catalog.beans.ActivitySpec> catalogActivitySpecList =
                 new ArrayList<org.onap.so.db.catalog.beans.ActivitySpec>();
         catalogActivitySpecList.add(catalogActivitySpec);
-        when(env.getProperty("mso.asdc.config.activity.endpoint")).thenReturn("testEndpoint");
+        when(env.getProperty("mso.asdc.config.activity.endpoint")).thenReturn("http://testEndpoint");
+        doReturn(true).when(deployActivitySpecs).checkHttpOk("http://testEndpoint");
         when(activitySpecRepository.findAll()).thenReturn(catalogActivitySpecList);
         doReturn("testActivityId").when(activitySpecsActions).createActivitySpec(Mockito.any(), Mockito.any());
         doReturn(true).when(activitySpecsActions).certifyActivitySpec(Mockito.any(), Mockito.any());
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
index 9b72bdc..7c7223e 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
@@ -89,9 +89,6 @@
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
 import org.springframework.web.client.RestTemplate;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonMappingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java
index 3c4c90c..89885f3 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java
@@ -36,7 +36,6 @@
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.json.JSONArray;
-import org.json.JSONException;
 import org.json.JSONObject;
 import org.onap.so.apihandler.common.ErrorNumbers;
 import org.onap.so.apihandler.common.RequestClient;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java
index 425e0b8..ac0d09b 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java
@@ -32,7 +32,7 @@
 
 @IdClass(ControllerSelectionReferenceId.class)
 @Entity
-@Table(name = "CONTROLLER_SELECTION_REFERENCE")
+@Table(name = "controller_selection_reference")
 public class ControllerSelectionReference implements Serializable {
 
     private static final long serialVersionUID = -608098800737567188L;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java
index c2cf2d7..9ec61ff 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java
@@ -17,7 +17,7 @@
 import com.openpojo.business.annotation.BusinessKey;
 
 @Entity
-@Table(name = "USER_PARAMETERS")
+@Table(name = "user_parameters")
 public class UserParameters implements Serializable {
 
     private static final long serialVersionUID = -5036895978102778877L;
