From 732930406687e4924fe0a56fd870cc49e639ba48 Mon Sep 17 00:00:00 2001 From: ChakshuGautam Date: Wed, 13 Oct 2021 18:09:25 +0530 Subject: [PATCH] Logs: Add log before parsing --- src/main/java/com/uci/dao/utils/XMessageDAOUtils.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/uci/dao/utils/XMessageDAOUtils.java b/src/main/java/com/uci/dao/utils/XMessageDAOUtils.java index 04fa76f..d223b5c 100644 --- a/src/main/java/com/uci/dao/utils/XMessageDAOUtils.java +++ b/src/main/java/com/uci/dao/utils/XMessageDAOUtils.java @@ -1,7 +1,8 @@ package com.uci.dao.utils; - import com.datastax.driver.core.utils.UUIDs; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import com.uci.dao.models.XMessageDAO; import messagerosa.core.model.XMessage; @@ -12,6 +13,8 @@ public class XMessageDAOUtils { + public static ObjectMapper mapper = new ObjectMapper(); + public static XMessageDAO convertXMessageToDAO(XMessage xmsg) { XMessageDAO xmsgDao = new XMessageDAO(); @@ -36,8 +39,9 @@ public static XMessageDAO convertXMessageToDAO(XMessage xmsg) { } try { + System.out.println(mapper.writeValueAsString(xmsg)); xmsgDao.setXMessage(xmsg.toXML()); - } catch (JAXBException e) { + } catch (JAXBException | JsonProcessingException e) { e.printStackTrace(); }