Repair widget micro service, onboarding of widgets
[portal.git] / ecomp-portal-BE-os / src / main / java / org / openecomp / portalapp / portal / service / ApplicationsRestClientServiceImpl.java
index 4626b17..f3fda34 100644 (file)
@@ -48,6 +48,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.stereotype.Service;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 import com.google.gson.JsonDeserializationContext;
@@ -71,6 +72,8 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient
        private AppsCacheService appsCacheService;
        Gson gson = null;
        
+       private final ObjectMapper mapper = new ObjectMapper();
+       
        @PostConstruct
        private void init(){
                logger.debug(EELFLoggerDelegate.debugLogger, "initializing");
@@ -185,7 +188,9 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient
                        verifyResponse(response);
                        String str = response.readEntity(String.class);
                        EcompPortalUtils.logAndSerializeObject(restPath, "GET result =", str);
-                   try { t = gson.fromJson(str, clazz); } catch(Exception e) {
+                   try { 
+                       t = mapper.readValue(str, clazz); 
+                   } catch(Exception e) {
                        logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
                        EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput); 
                        }