diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml
index 350a7b3..636e1fe 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml
@@ -102,14 +102,18 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.json</groupId>
-      <artifactId>json</artifactId>
-      <version>20090211</version>
-    </dependency>
-    <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>
       <version>3.5</version>
     </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>18.0</version>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
   </dependencies>
 </project>
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/NodeControllerState.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/NodeControllerState.java
index ca980b9..bf94dff 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/NodeControllerState.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/NodeControllerState.java
@@ -25,6 +25,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.hyracks.api.comm.NetworkAddress;
 import org.apache.hyracks.api.job.JobId;
 import org.apache.hyracks.control.common.base.INodeController;
@@ -33,8 +35,6 @@
 import org.apache.hyracks.control.common.heartbeat.HeartbeatData;
 import org.apache.hyracks.control.common.heartbeat.HeartbeatSchema;
 import org.apache.hyracks.control.common.heartbeat.HeartbeatSchema.GarbageCollectorInfo;
-import org.json.JSONException;
-import org.json.JSONObject;
 
 public class NodeControllerState {
     private static final int RRD_SIZE = 720;
@@ -277,13 +277,13 @@
     public NetworkAddress getMessagingPort() {
         return messagingPort;
     }
-
     public int getNumCores() {
         return numCores;
     }
 
-    public synchronized JSONObject toSummaryJSON() throws JSONException {
-        JSONObject o = new JSONObject();
+    public synchronized ObjectNode toSummaryJSON()  {
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode o = om.createObjectNode();
         o.put("node-id", ncConfig.nodeId);
         o.put("heap-used", heapUsedSize[(rrdPtr + RRD_SIZE - 1) % RRD_SIZE]);
         o.put("system-load-average", systemLoadAverage[(rrdPtr + RRD_SIZE - 1) % RRD_SIZE]);
@@ -291,8 +291,9 @@
         return o;
     }
 
-    public synchronized JSONObject toDetailedJSON(boolean includeStats, boolean includeConfig) throws JSONException {
-        JSONObject o = new JSONObject();
+    public synchronized ObjectNode toDetailedJSON(boolean includeStats, boolean includeConfig)  {
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode o = om.createObjectNode();
 
         o.put("node-id", ncConfig.nodeId);
 
@@ -304,45 +305,45 @@
             o.put("vm-name", vmName);
             o.put("vm-version", vmVersion);
             o.put("vm-vendor", vmVendor);
-            o.put("classpath", classpath.split(File.pathSeparator));
-            o.put("library-path", libraryPath.split(File.pathSeparator));
-            o.put("boot-classpath", bootClasspath.split(File.pathSeparator));
-            o.put("input-arguments", inputArguments);
-            o.put("system-properties", systemProperties);
+            o.putPOJO("classpath", classpath.split(File.pathSeparator));
+            o.putPOJO("library-path", libraryPath.split(File.pathSeparator));
+            o.putPOJO("boot-classpath", bootClasspath.split(File.pathSeparator));
+            o.putPOJO("input-arguments", inputArguments);
+            o.putPOJO("system-properties", systemProperties);
             o.put("pid", pid);
         }
         if (includeStats) {
-            o.put("date", new Date());
+            o.putPOJO("date", new Date());
             o.put("rrd-ptr", rrdPtr);
-            o.put("heartbeat-times", hbTime);
-            o.put("heap-init-sizes", heapInitSize);
-            o.put("heap-used-sizes", heapUsedSize);
-            o.put("heap-committed-sizes", heapCommittedSize);
-            o.put("heap-max-sizes", heapMaxSize);
-            o.put("nonheap-init-sizes", nonheapInitSize);
-            o.put("nonheap-used-sizes", nonheapUsedSize);
-            o.put("nonheap-committed-sizes", nonheapCommittedSize);
-            o.put("nonheap-max-sizes", nonheapMaxSize);
-            o.put("thread-counts", threadCount);
-            o.put("peak-thread-counts", peakThreadCount);
-            o.put("system-load-averages", systemLoadAverage);
-            o.put("gc-names", gcNames);
-            o.put("gc-collection-counts", gcCollectionCounts);
-            o.put("gc-collection-times", gcCollectionTimes);
-            o.put("net-payload-bytes-read", netPayloadBytesRead);
-            o.put("net-payload-bytes-written", netPayloadBytesWritten);
-            o.put("net-signaling-bytes-read", netSignalingBytesRead);
-            o.put("net-signaling-bytes-written", netSignalingBytesWritten);
-            o.put("dataset-net-payload-bytes-read", datasetNetPayloadBytesRead);
-            o.put("dataset-net-payload-bytes-written", datasetNetPayloadBytesWritten);
-            o.put("dataset-net-signaling-bytes-read", datasetNetSignalingBytesRead);
-            o.put("dataset-net-signaling-bytes-written", datasetNetSignalingBytesWritten);
-            o.put("ipc-messages-sent", ipcMessagesSent);
-            o.put("ipc-message-bytes-sent", ipcMessageBytesSent);
-            o.put("ipc-messages-received", ipcMessagesReceived);
-            o.put("ipc-message-bytes-received", ipcMessageBytesReceived);
-            o.put("disk-reads", diskReads);
-            o.put("disk-writes", diskWrites);
+            o.putPOJO("heartbeat-times", hbTime);
+            o.putPOJO("heap-init-sizes", heapInitSize);
+            o.putPOJO("heap-used-sizes", heapUsedSize);
+            o.putPOJO("heap-committed-sizes", heapCommittedSize);
+            o.putPOJO("heap-max-sizes", heapMaxSize);
+            o.putPOJO("nonheap-init-sizes", nonheapInitSize);
+            o.putPOJO("nonheap-used-sizes", nonheapUsedSize);
+            o.putPOJO("nonheap-committed-sizes", nonheapCommittedSize);
+            o.putPOJO("nonheap-max-sizes", nonheapMaxSize);
+            o.putPOJO("thread-counts", threadCount);
+            o.putPOJO("peak-thread-counts", peakThreadCount);
+            o.putPOJO("system-load-averages", systemLoadAverage);
+            o.putPOJO("gc-names", gcNames);
+            o.putPOJO("gc-collection-counts", gcCollectionCounts);
+            o.putPOJO("gc-collection-times", gcCollectionTimes);
+            o.putPOJO("net-payload-bytes-read", netPayloadBytesRead);
+            o.putPOJO("net-payload-bytes-written", netPayloadBytesWritten);
+            o.putPOJO("net-signaling-bytes-read", netSignalingBytesRead);
+            o.putPOJO("net-signaling-bytes-written", netSignalingBytesWritten);
+            o.putPOJO("dataset-net-payload-bytes-read", datasetNetPayloadBytesRead);
+            o.putPOJO("dataset-net-payload-bytes-written", datasetNetPayloadBytesWritten);
+            o.putPOJO("dataset-net-signaling-bytes-read", datasetNetSignalingBytesRead);
+            o.putPOJO("dataset-net-signaling-bytes-written", datasetNetSignalingBytesWritten);
+            o.putPOJO("ipc-messages-sent", ipcMessagesSent);
+            o.putPOJO("ipc-message-bytes-sent", ipcMessageBytesSent);
+            o.putPOJO("ipc-messages-received", ipcMessagesReceived);
+            o.putPOJO("ipc-message-bytes-received", ipcMessageBytesReceived);
+            o.putPOJO("disk-reads", diskReads);
+            o.putPOJO("disk-writes", diskWrites);
         }
 
         return o;
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/adminconsole/pages/IndexPage.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/adminconsole/pages/IndexPage.java
index 32ac3f5..680c2a7 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/adminconsole/pages/IndexPage.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/adminconsole/pages/IndexPage.java
@@ -18,22 +18,23 @@
  */
 package org.apache.hyracks.control.cc.adminconsole.pages;
 
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.collect.Lists;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;
 import org.apache.wicket.markup.html.list.ListItem;
 import org.apache.wicket.markup.html.list.ListView;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
 
 import org.apache.hyracks.control.cc.ClusterControllerService;
-import org.apache.hyracks.control.cc.web.util.JSONUtils;
 import org.apache.hyracks.control.cc.work.GetJobSummariesJSONWork;
 import org.apache.hyracks.control.cc.work.GetNodeSummariesJSONWork;
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.List;
 
 public class IndexPage extends AbstractPage {
     private static final long serialVersionUID = 1L;
@@ -43,49 +44,42 @@
 
         GetNodeSummariesJSONWork gnse = new GetNodeSummariesJSONWork(ccs);
         ccs.getWorkQueue().scheduleAndSync(gnse);
-        JSONArray nodeSummaries = gnse.getSummaries();
-        add(new Label("node-count", String.valueOf(nodeSummaries.length())));
-        ListView<JSONObject> nodeList = new ListView<JSONObject>("node-list", JSONUtils.toList(nodeSummaries)) {
+        ArrayNode nodeSummaries = gnse.getSummaries();
+        add(new Label("node-count", String.valueOf(nodeSummaries.size())));
+        ListView<JsonNode> nodeList = new ListView<JsonNode>("node-list",
+                Lists.newArrayList(nodeSummaries.iterator())) {
             private static final long serialVersionUID = 1L;
 
             @Override
-            protected void populateItem(ListItem<JSONObject> item) {
-                JSONObject o = item.getModelObject();
-                try {
-                    item.add(new Label("node-id", o.getString("node-id")));
-                    item.add(new Label("heap-used", o.getString("heap-used")));
-                    item.add(new Label("system-load-average", o.getString("system-load-average")));
-                    PageParameters params = new PageParameters();
-                    params.add("node-id", o.getString("node-id"));
-                    item.add(new BookmarkablePageLink<Object>("node-details", NodeDetailsPage.class, params));
-                } catch (JSONException e) {
-                    throw new RuntimeException(e);
-                }
+            protected void populateItem(ListItem<JsonNode> item) {
+                JsonNode o = item.getModelObject();
+                item.add(new Label("node-id", o.get("node-id").asText()));
+                item.add(new Label("heap-used", o.get("heap-used").asText()));
+                item.add(new Label("system-load-average", o.get("system-load-average").asText()));
+                PageParameters params = new PageParameters();
+                params.add("node-id", o.get("node-id").asText());
+                item.add(new BookmarkablePageLink<Object>("node-details", NodeDetailsPage.class, params));
             }
         };
         add(nodeList);
 
         GetJobSummariesJSONWork gjse = new GetJobSummariesJSONWork(ccs);
         ccs.getWorkQueue().scheduleAndSync(gjse);
-        JSONArray jobSummaries = gjse.getSummaries();
-        ListView<JSONObject> jobList = new ListView<JSONObject>("jobs-list", JSONUtils.toList(jobSummaries)) {
+        ArrayNode jobSummaries = gjse.getSummaries();
+        ListView<JsonNode> jobList = new ListView<JsonNode>("jobs-list", Lists.newArrayList(jobSummaries.iterator())) {
             private static final long serialVersionUID = 1L;
 
             @Override
-            protected void populateItem(ListItem<JSONObject> item) {
-                JSONObject o = item.getModelObject();
-                try {
-                    item.add(new Label("job-id", o.getString("job-id")));
-                    item.add(new Label("status", o.getString("status")));
-                    item.add(new Label("create-time", longToDateString(Long.parseLong(o.getString("create-time")))));
-                    item.add(new Label("start-time", longToDateString(Long.parseLong(o.getString("start-time")))));
-                    item.add(new Label("end-time", longToDateString(Long.parseLong(o.getString("end-time")))));
-                    PageParameters params = new PageParameters();
-                    params.add("job-id", o.getString("job-id"));
-                    item.add(new BookmarkablePageLink<Object>("job-details", JobDetailsPage.class, params));
-                } catch (JSONException e) {
-                    throw new RuntimeException(e);
-                }
+            protected void populateItem(ListItem<JsonNode> item) {
+                JsonNode o = item.getModelObject();
+                item.add(new Label("job-id", o.get("job-id").asText()));
+                item.add(new Label("status", o.get("status").asText()));
+                item.add(new Label("create-time", longToDateString(Long.parseLong(o.get("create-time").asText()))));
+                item.add(new Label("start-time", longToDateString(Long.parseLong(o.get("start-time").asText()))));
+                item.add(new Label("end-time", longToDateString(Long.parseLong(o.get("end-time").asText()))));
+                PageParameters params = new PageParameters();
+                params.add("job-id", o.get("job-id"));
+                item.add(new BookmarkablePageLink<Object>("job-details", JobDetailsPage.class, params));
             }
         };
         add(jobList);
@@ -99,4 +93,4 @@
         Date date = new Date(milliseconds);
         return sdf.format(date);
     }
-}
\ No newline at end of file
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/adminconsole/pages/JobDetailsPage.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/adminconsole/pages/JobDetailsPage.java
index 7898122..abc07d9 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/adminconsole/pages/JobDetailsPage.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/adminconsole/pages/JobDetailsPage.java
@@ -26,11 +26,12 @@
 import java.util.List;
 import java.util.Map;
 
+import com.fasterxml.jackson.databind.JsonNode;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.util.string.StringValue;
-import org.json.JSONArray;
-import org.json.JSONObject;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 
 import org.apache.hyracks.api.dataflow.ActivityId;
 import org.apache.hyracks.api.dataflow.TaskAttemptId;
@@ -58,19 +59,19 @@
         jag.setEscapeModelStrings(false);
         add(jag);
 
-        JSONObject jagO = gacgw.getJSON();
+        ObjectNode jagO = gacgw.getJSON();
 
         Map<ActivityId, String> activityMap = new HashMap<ActivityId, String>();
         if (jagO.has("activity-clusters")) {
-            JSONArray acArray = jagO.getJSONArray("activity-clusters");
-            for (int j = 0; j < acArray.length(); ++j) {
-                JSONObject acO = acArray.getJSONObject(j);
+            JsonNode acArray = jagO.get("activity-clusters");
+            for (int j = 0; j < acArray.size(); ++j) {
+                JsonNode acO = acArray.get(j);
                 if (acO.has("activities")) {
-                    JSONArray aArray = acO.getJSONArray("activities");
-                    for (int i = 0; i < aArray.length(); ++i) {
-                        JSONObject aO = aArray.getJSONObject(i);
-                        ActivityId aid = ActivityId.parse(aO.getString("id"));
-                        String className = aO.getString("java-class");
+                    JsonNode aArray = acO.get("activities");
+                    for (int i = 0; i < aArray.size(); ++i) {
+                        JsonNode aO = aArray.get(i);
+                        ActivityId aid = ActivityId.parse(aO.get("id").asText());
+                        String className = aO.get("java-class").asText();
 
                         activityMap.put(aid, className);
                     }
@@ -84,30 +85,30 @@
         jobrun.setEscapeModelStrings(false);
         add(jobrun);
 
-        JSONObject jrO = gjrw.getJSON();
+        ObjectNode jrO = gjrw.getJSON();
 
         List<TaskClusterAttempt[]> tcList = new ArrayList<TaskClusterAttempt[]>();
         long minTime = Long.MAX_VALUE;
         long maxTime = Long.MIN_VALUE;
         if (jrO.has("activity-clusters")) {
-            JSONArray acA = jrO.getJSONArray("activity-clusters");
-            for (int i = 0; i < acA.length(); ++i) {
-                JSONObject acO = acA.getJSONObject(i);
+            JsonNode acA = jrO.get("activity-clusters");
+            for (int i = 0; i < acA.size(); ++i) {
+                JsonNode acO = acA.get(i);
                 if (acO.has("plan")) {
-                    JSONObject planO = acO.getJSONObject("plan");
+                    JsonNode planO = acO.get("plan");
                     if (planO.has("task-clusters")) {
-                        JSONArray tcA = planO.getJSONArray("task-clusters");
-                        for (int j = 0; j < tcA.length(); ++j) {
-                            JSONObject tcO = tcA.getJSONObject(j);
-                            String tcId = tcO.getString("task-cluster-id");
+                        JsonNode tcA = planO.get("task-clusters");
+                        for (int j = 0; j < tcA.size(); ++j) {
+                            JsonNode tcO = tcA.get(j);
+                            String tcId = tcO.get("task-cluster-id").asText();
                             if (tcO.has("attempts")) {
-                                JSONArray tcaA = tcO.getJSONArray("attempts");
-                                TaskClusterAttempt[] tcAttempts = new TaskClusterAttempt[tcaA.length()];
-                                for (int k = 0; k < tcaA.length(); ++k) {
-                                    JSONObject tcaO = tcaA.getJSONObject(k);
-                                    int attempt = tcaO.getInt("attempt");
-                                    long startTime = tcaO.getLong("start-time");
-                                    long endTime = tcaO.getLong("end-time");
+                                JsonNode tcaA = tcO.get("attempts");
+                                TaskClusterAttempt[] tcAttempts = new TaskClusterAttempt[tcaA.size()];
+                                for (int k = 0; k < tcaA.size(); ++k) {
+                                    JsonNode tcaO = tcaA.get(k);
+                                    int attempt = tcaO.get("attempt").asInt();
+                                    long startTime = tcaO.get("start-time").asLong();
+                                    long endTime = tcaO.get("end-time").asLong();
 
                                     tcAttempts[k] = new TaskClusterAttempt(tcId, attempt, startTime, endTime);
                                     if (startTime < minTime) {
@@ -117,13 +118,13 @@
                                         maxTime = endTime;
                                     }
                                     if (tcaO.has("task-attempts")) {
-                                        JSONArray taArray = tcaO.getJSONArray("task-attempts");
-                                        tcAttempts[k].tasks = new TaskAttempt[taArray.length()];
-                                        for (int l = 0; l < taArray.length(); ++l) {
-                                            JSONObject taO = taArray.getJSONObject(l);
-                                            TaskAttemptId taId = TaskAttemptId.parse(taO.getString("task-attempt-id"));
-                                            TaskAttempt ta = new TaskAttempt(taId, taO.getLong("start-time"),
-                                                    taO.getLong("end-time"));
+                                        JsonNode taArray = tcaO.get("task-attempts");
+                                        tcAttempts[k].tasks = new TaskAttempt[taArray.size()];
+                                        for (int l = 0; l < taArray.size(); ++l) {
+                                            JsonNode taO = taArray.get(l);
+                                            TaskAttemptId taId = TaskAttemptId.parse(taO.get("task-attempt-id").asText());
+                                            TaskAttempt ta = new TaskAttempt(taId, taO.get("start-time").asLong(),
+                                                    taO.get("end-time").asLong());
                                             tcAttempts[k].tasks[l] = ta;
                                             TaskId tid = taId.getTaskId();
                                             ta.name = activityMap.get(tid.getActivityId());
@@ -154,31 +155,31 @@
 
         Map<TaskAttemptId, TaskProfile> tpMap = new HashMap<TaskAttemptId, TaskProfile>();
         if (jrO.has("profile")) {
-            JSONObject pO = jrO.getJSONObject("profile");
+            JsonNode pO = jrO.get("profile");
             if (pO.has("joblets")) {
-                JSONArray jobletsA = pO.getJSONArray("joblets");
-                for (int i = 0; i < jobletsA.length(); ++i) {
-                    JSONObject jobletO = jobletsA.getJSONObject(i);
+                JsonNode jobletsA = pO.get("joblets");
+                for (int i = 0; i < jobletsA.size(); ++i) {
+                    JsonNode jobletO = jobletsA.get(i);
                     if (jobletO.has("tasks")) {
-                        JSONArray tasksA = jobletO.getJSONArray("tasks");
-                        for (int j = 0; j < tasksA.length(); ++j) {
-                            JSONObject taskO = tasksA.getJSONObject(j);
-                            ActivityId activityId = ActivityId.parse(taskO.getString("activity-id"));
-                            int partition = taskO.getInt("partition");
-                            int attempt = taskO.getInt("attempt");
+                        JsonNode tasksA = jobletO.get("tasks");
+                        for (int j = 0; j < tasksA.size(); ++j) {
+                            JsonNode taskO = tasksA.get(j);
+                            ActivityId activityId = ActivityId.parse(taskO.get("activity-id").asText());
+                            int partition = taskO.get("partition").asInt();
+                            int attempt = taskO.get("attempt").asInt();
                             TaskAttemptId taId = new TaskAttemptId(new TaskId(activityId, partition), attempt);
                             if (taskO.has("partition-send-profile")) {
-                                JSONArray taskProfilesA = taskO.getJSONArray("partition-send-profile");
-                                for (int k = 0; k < taskProfilesA.length(); ++k) {
-                                    JSONObject ppO = taskProfilesA.getJSONObject(k);
-                                    long openTime = ppO.getLong("open-time");
-                                    long closeTime = ppO.getLong("close-time");
-                                    int resolution = ppO.getInt("resolution");
-                                    long offset = ppO.getLong("offset");
-                                    JSONArray frameTimesA = ppO.getJSONArray("frame-times");
-                                    long[] frameTimes = new long[frameTimesA.length()];
+                                JsonNode taskProfilesA = taskO.get("partition-send-profile");
+                                for (int k = 0; k < taskProfilesA.size(); ++k) {
+                                    JsonNode ppO = taskProfilesA.get(k);
+                                    long openTime = ppO.get("open-time").asLong();
+                                    long closeTime = ppO.get("close-time").asLong();
+                                    int resolution = ppO.get("resolution").asInt();
+                                    long offset = ppO.get("offset").asLong();
+                                    JsonNode frameTimesA = ppO.get("frame-times");
+                                    long[] frameTimes = new long[frameTimesA.size()];
                                     for (int l = 0; l < frameTimes.length; ++l) {
-                                        frameTimes[l] = frameTimesA.getInt(l) + offset;
+                                        frameTimes[l] = frameTimesA.get(l).asLong() + offset;
                                     }
                                     TaskProfile tp = new TaskProfile(taId, openTime, closeTime, frameTimes, resolution);
                                     if (!tpMap.containsKey(tp.taId)) {
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobRun.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobRun.java
index dbe4202..f1d04bb 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobRun.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobRun.java
@@ -28,10 +28,9 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.hyracks.api.dataflow.ActivityId;
 import org.apache.hyracks.api.dataflow.ConnectorDescriptorId;
 import org.apache.hyracks.api.dataflow.OperatorDescriptorId;
@@ -237,131 +236,132 @@
         return connectorPolicyMap;
     }
 
-    public JSONObject toJSON() throws JSONException {
-        JSONObject result = new JSONObject();
+    public ObjectNode toJSON()  {
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode result = om.createObjectNode();
 
         result.put("job-id", jobId.toString());
-        result.put("status", getStatus());
+        result.putPOJO("status", getStatus());
         result.put("create-time", getCreateTime());
         result.put("start-time", getStartTime());
         result.put("end-time", getEndTime());
 
-        JSONArray aClusters = new JSONArray();
+        ArrayNode aClusters = om.createArrayNode();
         for (ActivityCluster ac : acg.getActivityClusterMap().values()) {
-            JSONObject acJSON = new JSONObject();
+            ObjectNode acJSON = om.createObjectNode();
 
             acJSON.put("activity-cluster-id", String.valueOf(ac.getId()));
 
-            JSONArray activitiesJSON = new JSONArray();
+            ArrayNode activitiesJSON = om.createArrayNode();
             for (ActivityId aid : ac.getActivityMap().keySet()) {
-                activitiesJSON.put(aid);
+                activitiesJSON.addPOJO(aid);
             }
-            acJSON.put("activities", activitiesJSON);
+            acJSON.set("activities", activitiesJSON);
 
-            JSONArray dependenciesJSON = new JSONArray();
+            ArrayNode dependenciesJSON = om.createArrayNode();
             for (ActivityCluster dependency : ac.getDependencies()) {
-                dependenciesJSON.put(String.valueOf(dependency.getId()));
+                dependenciesJSON.add(String.valueOf(dependency.getId()));
             }
-            acJSON.put("dependencies", dependenciesJSON);
+            acJSON.set("dependencies", dependenciesJSON);
 
             ActivityClusterPlan acp = activityClusterPlanMap.get(ac.getId());
             if (acp == null) {
-                acJSON.put("plan", (Object) null);
+                acJSON.putNull("plan");
             } else {
-                JSONObject planJSON = new JSONObject();
+                ObjectNode planJSON = om.createObjectNode();
 
-                JSONArray acTasks = new JSONArray();
+                ArrayNode acTasks = om.createArrayNode();
                 for (Map.Entry<ActivityId, ActivityPlan> e : acp.getActivityPlanMap().entrySet()) {
                     ActivityPlan acPlan = e.getValue();
-                    JSONObject entry = new JSONObject();
+                    ObjectNode entry = om.createObjectNode();
                     entry.put("activity-id", e.getKey().toString());
 
                     ActivityPartitionDetails apd = acPlan.getActivityPartitionDetails();
                     entry.put("partition-count", apd.getPartitionCount());
 
-                    JSONArray inPartCountsJSON = new JSONArray();
+                    ArrayNode inPartCountsJSON = om.createArrayNode();
                     int[] inPartCounts = apd.getInputPartitionCounts();
                     if (inPartCounts != null) {
                         for (int i : inPartCounts) {
-                            inPartCountsJSON.put(i);
+                            inPartCountsJSON.add(i);
                         }
                     }
-                    entry.put("input-partition-counts", inPartCountsJSON);
+                    entry.set("input-partition-counts", inPartCountsJSON);
 
-                    JSONArray outPartCountsJSON = new JSONArray();
+                    ArrayNode outPartCountsJSON = om.createArrayNode();
                     int[] outPartCounts = apd.getOutputPartitionCounts();
                     if (outPartCounts != null) {
                         for (int o : outPartCounts) {
-                            outPartCountsJSON.put(o);
+                            outPartCountsJSON.add(o);
                         }
                     }
-                    entry.put("output-partition-counts", outPartCountsJSON);
+                    entry.set("output-partition-counts", outPartCountsJSON);
 
-                    JSONArray tasks = new JSONArray();
+                    ArrayNode tasks = om.createArrayNode();
                     for (Task t : acPlan.getTasks()) {
-                        JSONObject task = new JSONObject();
+                        ObjectNode task = om.createObjectNode();
 
                         task.put("task-id", t.getTaskId().toString());
 
-                        JSONArray dependentTasksJSON = new JSONArray();
+                        ArrayNode dependentTasksJSON = om.createArrayNode();
                         for (TaskId dependent : t.getDependents()) {
-                            dependentTasksJSON.put(dependent.toString());
-                        }
-                        task.put("dependents", dependentTasksJSON);
+                            dependentTasksJSON.add(dependent.toString());
+                        task.set("dependents", dependentTasksJSON);
 
-                        JSONArray dependencyTasksJSON = new JSONArray();
+                        ArrayNode dependencyTasksJSON = om.createArrayNode();
                         for (TaskId dependency : t.getDependencies()) {
-                            dependencyTasksJSON.put(dependency.toString());
+                            dependencyTasksJSON.add(dependency.toString());
                         }
-                        task.put("dependencies", dependencyTasksJSON);
+                        task.set("dependencies", dependencyTasksJSON);
 
-                        tasks.put(task);
+                        tasks.add(task);
                     }
-                    entry.put("tasks", tasks);
+                    entry.set("tasks", tasks);
 
-                    acTasks.put(entry);
+                    acTasks.add(entry);
+                    }
                 }
-                planJSON.put("activities", acTasks);
+                planJSON.set("activities", acTasks);
 
-                JSONArray tClusters = new JSONArray();
+                ArrayNode tClusters = om.createArrayNode();
                 for (TaskCluster tc : acp.getTaskClusters()) {
-                    JSONObject c = new JSONObject();
+                    ObjectNode c = om.createObjectNode();
                     c.put("task-cluster-id", String.valueOf(tc.getTaskClusterId()));
 
-                    JSONArray tasks = new JSONArray();
+                    ArrayNode tasksAry = om.createArrayNode();
                     for (Task t : tc.getTasks()) {
-                        tasks.put(t.getTaskId().toString());
+                        tasksAry.add(t.getTaskId().toString());
                     }
-                    c.put("tasks", tasks);
+                    c.set("tasks", tasksAry);
 
-                    JSONArray prodParts = new JSONArray();
+                    ArrayNode prodParts = om.createArrayNode();
                     for (PartitionId p : tc.getProducedPartitions()) {
-                        prodParts.put(p.toString());
+                        prodParts.add(p.toString());
                     }
-                    c.put("produced-partitions", prodParts);
+                    c.set("produced-partitions", prodParts);
 
-                    JSONArray reqdParts = new JSONArray();
+                    ArrayNode reqdParts = om.createArrayNode();
                     for (PartitionId p : tc.getRequiredPartitions()) {
-                        reqdParts.put(p.toString());
+                        reqdParts.add(p.toString());
                     }
-                    c.put("required-partitions", reqdParts);
+                    c.set("required-partitions", reqdParts);
 
-                    JSONArray attempts = new JSONArray();
+                    ArrayNode attempts = om.createArrayNode();
                     List<TaskClusterAttempt> tcAttempts = tc.getAttempts();
                     if (tcAttempts != null) {
                         for (TaskClusterAttempt tca : tcAttempts) {
-                            JSONObject attempt = new JSONObject();
+                            ObjectNode attempt = om.createObjectNode();
                             attempt.put("attempt", tca.getAttempt());
-                            attempt.put("status", tca.getStatus());
+                            attempt.putPOJO("status", tca.getStatus());
                             attempt.put("start-time", tca.getStartTime());
                             attempt.put("end-time", tca.getEndTime());
 
-                            JSONArray taskAttempts = new JSONArray();
+                            ArrayNode taskAttempts = om.createArrayNode();
                             for (TaskAttempt ta : tca.getTaskAttempts().values()) {
-                                JSONObject taskAttempt = new JSONObject();
-                                taskAttempt.put("task-id", ta.getTaskAttemptId().getTaskId());
-                                taskAttempt.put("task-attempt-id", ta.getTaskAttemptId());
-                                taskAttempt.put("status", ta.getStatus());
+                                ObjectNode taskAttempt = om.createObjectNode();
+                                taskAttempt.putPOJO("task-id", ta.getTaskAttemptId().getTaskId());
+                                taskAttempt.putPOJO("task-attempt-id", ta.getTaskAttemptId());
+                                taskAttempt.putPOJO("status", ta.getStatus());
                                 taskAttempt.put("node-id", ta.getNodeId());
                                 taskAttempt.put("start-time", ta.getStartTime());
                                 taskAttempt.put("end-time", ta.getEndTime());
@@ -374,26 +374,26 @@
                                         taskAttempt.put("failure-details", exceptionWriter.toString());
                                     }
                                 }
-                                taskAttempts.put(taskAttempt);
+                                taskAttempts.add(taskAttempt);
                             }
-                            attempt.put("task-attempts", taskAttempts);
+                            attempt.set("task-attempts", taskAttempts);
 
-                            attempts.put(attempt);
+                            attempts.add(attempt);
                         }
                     }
-                    c.put("attempts", attempts);
+                    c.set("attempts", attempts);
 
-                    tClusters.put(c);
+                    tClusters.add(c);
                 }
-                planJSON.put("task-clusters", tClusters);
+                planJSON.set("task-clusters", tClusters);
 
-                acJSON.put("plan", planJSON);
+                acJSON.set("plan", planJSON);
             }
-            aClusters.put(acJSON);
+            aClusters.add(acJSON);
         }
-        result.put("activity-clusters", aClusters);
+        result.set("activity-clusters", aClusters);
 
-        result.put("profile", profile.toJSON());
+        result.set("profile", profile.toJSON());
 
         return result;
     }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/scheduler/JobScheduler.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/scheduler/JobScheduler.java
index ab026eb..b577ff7 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/scheduler/JobScheduler.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/scheduler/JobScheduler.java
@@ -31,9 +31,8 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import org.json.JSONException;
-import org.json.JSONObject;
-
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.hyracks.api.comm.NetworkAddress;
 import org.apache.hyracks.api.constraints.Constraint;
 import org.apache.hyracks.api.constraints.expressions.LValueConstraintExpression;
@@ -80,6 +79,7 @@
 
     private final Set<TaskCluster> inProgressTaskClusters;
 
+
     public JobScheduler(ClusterControllerService ccs, JobRun jobRun, Collection<Constraint> constraints) {
         this.ccs = ccs;
         this.jobRun = jobRun;
@@ -734,15 +734,12 @@
         }
     }
 
-    private JSONObject createJobLogObject(final JobRun run) {
-        JSONObject jobLogObject = new JSONObject();
-        try {
-            ActivityClusterGraph acg = run.getActivityClusterGraph();
-            jobLogObject.put("activity-cluster-graph", acg.toJSON());
-            jobLogObject.put("job-run", run.toJSON());
-        } catch (JSONException e) {
-            throw new RuntimeException(e);
-        }
+    private ObjectNode createJobLogObject(final JobRun run) {
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode jobLogObject = om.createObjectNode();
+        ActivityClusterGraph acg = run.getActivityClusterGraph();
+        jobLogObject.set("activity-cluster-graph", acg.toJSON());
+        jobLogObject.set("job-run", run.toJSON());
         return jobLogObject;
     }
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/JobsRESTAPIFunction.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/JobsRESTAPIFunction.java
index bab77ca..e69884a 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/JobsRESTAPIFunction.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/JobsRESTAPIFunction.java
@@ -18,7 +18,8 @@
  */
 package org.apache.hyracks.control.cc.web;
 
-import org.json.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 
 import org.apache.hyracks.api.job.JobId;
 import org.apache.hyracks.control.cc.ClusterControllerService;
@@ -35,8 +36,9 @@
     }
 
     @Override
-    public JSONObject invoke(String[] arguments) throws Exception {
-        JSONObject result = new JSONObject();
+    public ObjectNode invoke(String[] arguments) throws Exception {
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode result = om.createObjectNode();
         switch (arguments.length) {
             case 1:
                 if (!"".equals(arguments[0])) {
@@ -45,7 +47,7 @@
             case 0: {
                 GetJobSummariesJSONWork gjse = new GetJobSummariesJSONWork(ccs);
                 ccs.getWorkQueue().scheduleAndSync(gjse);
-                result.put("result", gjse.getSummaries());
+                result.set("result", gjse.getSummaries());
                 break;
             }
 
@@ -55,11 +57,11 @@
                 if ("job-activity-graph".equalsIgnoreCase(arguments[1])) {
                     GetActivityClusterGraphJSONWork gjage = new GetActivityClusterGraphJSONWork(ccs, jobId);
                     ccs.getWorkQueue().scheduleAndSync(gjage);
-                    result.put("result", gjage.getJSON());
+                    result.set("result", gjage.getJSON());
                 } else if ("job-run".equalsIgnoreCase(arguments[1])) {
                     GetJobRunJSONWork gjre = new GetJobRunJSONWork(ccs, jobId);
                     ccs.getWorkQueue().scheduleAndSync(gjre);
-                    result.put("result", gjre.getJSON());
+                    result.set("result", gjre.getJSON());
                 }
 
                 break;
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/NodesRESTAPIFunction.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/NodesRESTAPIFunction.java
index 58deb55..8994895 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/NodesRESTAPIFunction.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/NodesRESTAPIFunction.java
@@ -18,7 +18,8 @@
  */
 package org.apache.hyracks.control.cc.web;
 
-import org.json.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 
 import org.apache.hyracks.control.cc.ClusterControllerService;
 import org.apache.hyracks.control.cc.web.util.IJSONOutputFunction;
@@ -33,19 +34,20 @@
     }
 
     @Override
-    public JSONObject invoke(String[] arguments) throws Exception {
-        JSONObject result = new JSONObject();
+    public ObjectNode invoke(String[] arguments) throws Exception {
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode result = om.createObjectNode();
         switch (arguments.length) {
             case 1: {
                 if ("".equals(arguments[0])) {
                     GetNodeSummariesJSONWork gnse = new GetNodeSummariesJSONWork(ccs);
                     ccs.getWorkQueue().scheduleAndSync(gnse);
-                    result.put("result", gnse.getSummaries());
+                    result.set("result", gnse.getSummaries());
                 } else {
                     String nodeId = arguments[0];
                     GetNodeDetailsJSONWork gnde = new GetNodeDetailsJSONWork(ccs, nodeId, true, true);
                     ccs.getWorkQueue().scheduleAndSync(gnde);
-                    result.put("result", gnde.getDetail());
+                    result.set("result", gnde.getDetail());
                 }
             }
         }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/StateDumpRESTAPIFunction.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/StateDumpRESTAPIFunction.java
index 000cf46..0657f59 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/StateDumpRESTAPIFunction.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/StateDumpRESTAPIFunction.java
@@ -20,7 +20,8 @@
 
 import java.util.Map;
 
-import org.json.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 
 import org.apache.hyracks.control.cc.ClusterControllerService;
 import org.apache.hyracks.control.cc.web.util.IJSONOutputFunction;
@@ -35,13 +36,14 @@
     }
 
     @Override
-    public JSONObject invoke(String[] arguments) throws Exception {
+    public ObjectNode invoke(String[] arguments) throws Exception {
         GatherStateDumpsWork gsdw = new GatherStateDumpsWork(ccs);
         ccs.getWorkQueue().scheduleAndSync(gsdw);
         StateDumpRun sdr = gsdw.getStateDumpRun();
         sdr.waitForCompletion();
 
-        JSONObject result = new JSONObject();
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode result = om.createObjectNode();
         for (Map.Entry<String, String> e : sdr.getStateDump().entrySet()) {
             result.put(e.getKey(), e.getValue());
         }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/IJSONOutputFunction.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/IJSONOutputFunction.java
index f55bf84..ab0a581 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/IJSONOutputFunction.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/IJSONOutputFunction.java
@@ -18,8 +18,8 @@
  */
 package org.apache.hyracks.control.cc.web.util;
 
-import org.json.JSONObject;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 
 public interface IJSONOutputFunction {
-    public JSONObject invoke(String[] arguments) throws Exception;
+    public ObjectNode invoke(String[] arguments) throws Exception;
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONOutputRequestHandler.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONOutputRequestHandler.java
index b00eeae..e736406 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONOutputRequestHandler.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONOutputRequestHandler.java
@@ -24,9 +24,10 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.eclipse.jetty.server.Request;
 import org.eclipse.jetty.server.handler.AbstractHandler;
-import org.json.JSONObject;
 
 public class JSONOutputRequestHandler extends AbstractHandler {
     private final IJSONOutputFunction fn;
@@ -46,9 +47,10 @@
         }
         String[] parts = target.split("/");
         try {
-            JSONObject result = fn.invoke(parts);
+            ObjectNode result = fn.invoke(parts);
             response.setContentType("application/json");
-            result.write(response.getWriter());
+            ObjectMapper om = new ObjectMapper();
+            om.writer().writeValue(response.getWriter(),result);
             baseRequest.setHandled(true);
         } catch (Exception e) {
             e.printStackTrace();
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONUtils.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONUtils.java
deleted file mode 100644
index 5da4d9d..0000000
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONUtils.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.hyracks.control.cc.web.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-public class JSONUtils {
-    public static List<JSONObject> toList(JSONArray array) throws JSONException {
-        List<JSONObject> list = new ArrayList<JSONObject>();
-        for (int i = 0; i < array.length(); ++i) {
-            list.add((JSONObject) array.get(i));
-        }
-        return list;
-    }
-}
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetActivityClusterGraphJSONWork.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetActivityClusterGraphJSONWork.java
index 951e67e..294ae97 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetActivityClusterGraphJSONWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetActivityClusterGraphJSONWork.java
@@ -18,7 +18,8 @@
  */
 package org.apache.hyracks.control.cc.work;
 
-import org.json.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 
 import org.apache.hyracks.api.job.JobId;
 import org.apache.hyracks.control.cc.ClusterControllerService;
@@ -28,7 +29,7 @@
 public class GetActivityClusterGraphJSONWork extends SynchronizableWork {
     private final ClusterControllerService ccs;
     private final JobId jobId;
-    private JSONObject json;
+    private ObjectNode json;
 
     public GetActivityClusterGraphJSONWork(ClusterControllerService ccs, JobId jobId) {
         this.ccs = ccs;
@@ -37,18 +38,20 @@
 
     @Override
     protected void doRun() throws Exception {
+
+        ObjectMapper om = new ObjectMapper();
         JobRun run = ccs.getActiveRunMap().get(jobId);
         if (run == null) {
             run = ccs.getRunMapArchive().get(jobId);
             if (run == null) {
-                json = new JSONObject();
+                json = om.createObjectNode();
                 return;
             }
         }
         json = run.getActivityClusterGraph().toJSON();
     }
 
-    public JSONObject getJSON() {
+    public ObjectNode getJSON() {
         return json;
     }
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetJobRunJSONWork.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetJobRunJSONWork.java
index f2119c3..aad6edf 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetJobRunJSONWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetJobRunJSONWork.java
@@ -18,7 +18,8 @@
  */
 package org.apache.hyracks.control.cc.work;
 
-import org.json.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 
 import org.apache.hyracks.api.job.JobId;
 import org.apache.hyracks.control.cc.ClusterControllerService;
@@ -28,7 +29,7 @@
 public class GetJobRunJSONWork extends SynchronizableWork {
     private final ClusterControllerService ccs;
     private final JobId jobId;
-    private JSONObject json;
+    private ObjectNode json;
 
     public GetJobRunJSONWork(ClusterControllerService ccs, JobId jobId) {
         this.ccs = ccs;
@@ -37,18 +38,19 @@
 
     @Override
     protected void doRun() throws Exception {
+        ObjectMapper om = new ObjectMapper();
         JobRun run = ccs.getActiveRunMap().get(jobId);
         if (run == null) {
             run = ccs.getRunMapArchive().get(jobId);
             if (run == null) {
-                json = new JSONObject();
+                json = om.createObjectNode();
                 return;
             }
         }
         json = run.toJSON();
     }
 
-    public JSONObject getJSON() {
+    public ObjectNode getJSON() {
         return json;
     }
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetJobSummariesJSONWork.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetJobSummariesJSONWork.java
index bc4468a..1e5a3a5 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetJobSummariesJSONWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetJobSummariesJSONWork.java
@@ -20,17 +20,16 @@
 
 import java.util.Collection;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.hyracks.control.cc.ClusterControllerService;
 import org.apache.hyracks.control.cc.job.JobRun;
 import org.apache.hyracks.control.common.work.SynchronizableWork;
 
 public class GetJobSummariesJSONWork extends SynchronizableWork {
     private final ClusterControllerService ccs;
-    private JSONArray summaries;
+    private ArrayNode summaries;
 
     public GetJobSummariesJSONWork(ClusterControllerService ccs) {
         this.ccs = ccs;
@@ -38,25 +37,27 @@
 
     @Override
     protected void doRun() throws Exception {
-        summaries = new JSONArray();
+        ObjectMapper om = new ObjectMapper();
+        summaries = om.createArrayNode();
         populateJSON(ccs.getActiveRunMap().values());
         populateJSON(ccs.getRunMapArchive().values());
     }
 
-    private void populateJSON(Collection<JobRun> jobRuns) throws JSONException {
+    private void populateJSON(Collection<JobRun> jobRuns)  {
+        ObjectMapper om = new ObjectMapper();
         for (JobRun run : jobRuns) {
-            JSONObject jo = new JSONObject();
+            ObjectNode jo = om.createObjectNode();
             jo.put("type", "job-summary");
             jo.put("job-id", run.getJobId().toString());
             jo.put("create-time", run.getCreateTime());
             jo.put("start-time", run.getStartTime());
             jo.put("end-time", run.getEndTime());
             jo.put("status", run.getStatus().toString());
-            summaries.put(jo);
+            summaries.add(jo);
         }
     }
 
-    public JSONArray getSummaries() {
+    public ArrayNode getSummaries() {
         return summaries;
     }
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeDetailsJSONWork.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeDetailsJSONWork.java
index dab41ba..4a8dd1f 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeDetailsJSONWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeDetailsJSONWork.java
@@ -35,13 +35,13 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.hyracks.control.cc.ClusterControllerService;
 import org.apache.hyracks.control.cc.NodeControllerState;
 import org.apache.hyracks.control.common.utils.PidHelper;
 import org.apache.hyracks.control.common.work.IPCResponder;
 import org.apache.hyracks.control.common.work.SynchronizableWork;
-import org.json.JSONException;
-import org.json.JSONObject;
 import org.kohsuke.args4j.Option;
 
 public class GetNodeDetailsJSONWork extends SynchronizableWork {
@@ -51,7 +51,8 @@
     private final boolean includeStats;
     private final boolean includeConfig;
     private final IPCResponder<String> callback;
-    private JSONObject detail;
+    private ObjectNode detail;
+    private ObjectMapper om = new ObjectMapper();
 
     public GetNodeDetailsJSONWork(ClusterControllerService ccs, String nodeId, boolean includeStats,
                                   boolean includeConfig, IPCResponder<String> callback) {
@@ -86,12 +87,12 @@
         }
 
         if (callback != null) {
-            callback.setValue(detail == null ? null : detail.toString());
+            callback.setValue(detail == null ? null : om.writeValueAsString(detail));
         }
     }
 
-    private JSONObject getCCDetails() throws JSONException {
-        JSONObject o = new JSONObject();
+    private ObjectNode getCCDetails()  {
+        ObjectNode o = om.createObjectNode();
         MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
         List<GarbageCollectorMXBean> gcMXBeans = ManagementFactory.getGarbageCollectorMXBeans();
         ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
@@ -106,29 +107,29 @@
             o.put("vm_name", runtimeMXBean.getVmName());
             o.put("vm_version", runtimeMXBean.getVmVersion());
             o.put("vm_vendor", runtimeMXBean.getVmVendor());
-            o.put("classpath", runtimeMXBean.getClassPath().split(File.pathSeparator));
-            o.put("library_path", runtimeMXBean.getLibraryPath().split(File.pathSeparator));
-            o.put("boot_classpath", runtimeMXBean.getBootClassPath().split(File.pathSeparator));
-            o.put("input_arguments", runtimeMXBean.getInputArguments());
-            o.put("system_properties", runtimeMXBean.getSystemProperties());
+            o.putPOJO("classpath", runtimeMXBean.getClassPath().split(File.pathSeparator));
+            o.putPOJO("library_path", runtimeMXBean.getLibraryPath().split(File.pathSeparator));
+            o.putPOJO("boot_classpath", runtimeMXBean.getBootClassPath().split(File.pathSeparator));
+            o.putPOJO("input_arguments", runtimeMXBean.getInputArguments());
+            o.putPOJO("system_properties", runtimeMXBean.getSystemProperties());
             o.put("pid", PidHelper.getPid());
         }
         if (includeStats) {
             MemoryUsage heapUsage = memoryMXBean.getHeapMemoryUsage();
             MemoryUsage nonheapUsage = memoryMXBean.getNonHeapMemoryUsage();
 
-            List<JSONObject> gcs = new ArrayList<>();
+            List<ObjectNode> gcs = new ArrayList<>();
 
             for (GarbageCollectorMXBean gcMXBean : gcMXBeans) {
-                JSONObject gc = new JSONObject();
+                ObjectNode gc = om.createObjectNode();
                 gc.put("name", gcMXBean.getName());
                 gc.put("collection-time", gcMXBean.getCollectionTime());
                 gc.put("collection-count", gcMXBean.getCollectionCount());
                 gcs.add(gc);
             }
-            o.put("gcs", gcs);
+            o.putPOJO("gcs", gcs);
 
-            o.put("date", new Date());
+            o.put("date", new Date().toString());
             o.put("heap_init_size", heapUsage.getInit());
             o.put("heap_used_size", heapUsage.getUsed());
             o.put("heap_committed_size", heapUsage.getCommitted());
@@ -145,7 +146,7 @@
         return o;
     }
 
-    private static void addIni(JSONObject o, Object configBean) throws JSONException {
+    private static void addIni(ObjectNode o, Object configBean)  {
         Map<String, Object> iniMap = new HashMap<>();
         for (Field f : configBean.getClass().getFields()) {
             Option option = f.getAnnotation(Option.class);
@@ -170,10 +171,10 @@
                 }
             }
         }
-        o.put("ini", iniMap);
+        o.putPOJO("ini", iniMap);
     }
 
-    public JSONObject getDetail() {
+    public ObjectNode getDetail() {
         return detail;
     }
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeSummariesJSONWork.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeSummariesJSONWork.java
index 4b81ad0..ebafd7d 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeSummariesJSONWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeSummariesJSONWork.java
@@ -18,7 +18,8 @@
  */
 package org.apache.hyracks.control.cc.work;
 
-import org.json.JSONArray;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
 
 import org.apache.hyracks.control.cc.ClusterControllerService;
 import org.apache.hyracks.control.cc.NodeControllerState;
@@ -26,7 +27,7 @@
 
 public class GetNodeSummariesJSONWork extends SynchronizableWork {
     private final ClusterControllerService ccs;
-    private JSONArray summaries;
+    private ArrayNode summaries;
 
     public GetNodeSummariesJSONWork(ClusterControllerService ccs) {
         this.ccs = ccs;
@@ -34,13 +35,14 @@
 
     @Override
     protected void doRun() throws Exception {
-        summaries = new JSONArray();
+        ObjectMapper om = new ObjectMapper();
+        summaries = om.createArrayNode();
         for (NodeControllerState ncs : ccs.getNodeMap().values()) {
-            summaries.put(ncs.toSummaryJSON());
+            summaries.add(ncs.toSummaryJSON());
         }
     }
 
-    public JSONArray getSummaries() {
+    public ArrayNode getSummaries() {
         return summaries;
     }
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobCleanupWork.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobCleanupWork.java
index bd85463..2a383b6 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobCleanupWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobCleanupWork.java
@@ -23,9 +23,8 @@
 import java.util.Set;
 import java.util.logging.Logger;
 
-import org.json.JSONException;
-import org.json.JSONObject;
-
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.hyracks.api.exceptions.HyracksException;
 import org.apache.hyracks.api.job.ActivityClusterGraph;
 import org.apache.hyracks.api.job.JobId;
@@ -123,15 +122,12 @@
         }
     }
 
-    private JSONObject createJobLogObject(final JobRun run) {
-        JSONObject jobLogObject = new JSONObject();
-        try {
-            ActivityClusterGraph acg = run.getActivityClusterGraph();
-            jobLogObject.put("activity-cluster-graph", acg.toJSON());
-            jobLogObject.put("job-run", run.toJSON());
-        } catch (JSONException e) {
-            throw new RuntimeException(e);
-        }
+    private ObjectNode createJobLogObject(final JobRun run) {
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode jobLogObject = om.createObjectNode();
+        ActivityClusterGraph acg = run.getActivityClusterGraph();
+        jobLogObject.set("activity-cluster-graph", acg.toJSON());
+        jobLogObject.set("job-run", run.toJSON());
         return jobLogObject;
     }
 
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/pom.xml b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/pom.xml
index 9f7d9dd..1c8ae20 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/pom.xml
@@ -58,11 +58,6 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.json</groupId>
-      <artifactId>json</artifactId>
-      <version>20090211</version>
-    </dependency>
-    <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpcore</artifactId>
       <version>4.4.5</version>
@@ -72,5 +67,9 @@
       <artifactId>httpclient</artifactId>
       <version>4.5.2</version>
     </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
   </dependencies>
 </project>
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/AbstractProfile.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/AbstractProfile.java
index 525be8c..d1d33a5 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/AbstractProfile.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/AbstractProfile.java
@@ -26,9 +26,9 @@
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 
 import org.apache.hyracks.api.io.IWritable;
 
@@ -45,17 +45,18 @@
         return counters;
     }
 
-    public abstract JSONObject toJSON() throws JSONException;
+    public abstract ObjectNode toJSON() ;
 
-    protected void populateCounters(JSONObject jo) throws JSONException {
-        JSONArray countersObj = new JSONArray();
+    protected void populateCounters(ObjectNode jo) {
+        ObjectMapper om = new ObjectMapper();
+        ArrayNode countersObj = om.createArrayNode();
         for (Map.Entry<String, Long> e : counters.entrySet()) {
-            JSONObject jpe = new JSONObject();
+            ObjectNode jpe = om.createObjectNode();
             jpe.put("name", e.getKey());
             jpe.put("value", e.getValue());
-            countersObj.put(jpe);
+            countersObj.add(jpe);
         }
-        jo.put("counters", countersObj);
+        jo.set("counters", countersObj);
     }
 
     protected void merge(AbstractProfile profile) {
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/JobProfile.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/JobProfile.java
index e8fec1b..79a5538 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/JobProfile.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/JobProfile.java
@@ -25,10 +25,9 @@
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.hyracks.api.job.JobId;
 
 public class JobProfile extends AbstractProfile {
@@ -62,16 +61,17 @@
     }
 
     @Override
-    public JSONObject toJSON() throws JSONException {
-        JSONObject json = new JSONObject();
+    public ObjectNode toJSON()  {
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode json = om.createObjectNode();
 
         json.put("job-id", jobId.toString());
         populateCounters(json);
-        JSONArray jobletsArray = new JSONArray();
+        ArrayNode jobletsArray = om.createArrayNode();
         for (JobletProfile p : jobletProfiles.values()) {
-            jobletsArray.put(p.toJSON());
+            jobletsArray.add(p.toJSON());
         }
-        json.put("joblets", jobletsArray);
+        json.set("joblets", jobletsArray);
 
         return json;
     }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/JobletProfile.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/JobletProfile.java
index 33d5a6c..c3792df 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/JobletProfile.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/JobletProfile.java
@@ -25,10 +25,10 @@
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.hyracks.api.dataflow.TaskAttemptId;
 
 public class JobletProfile extends AbstractProfile {
@@ -62,16 +62,18 @@
     }
 
     @Override
-    public JSONObject toJSON() throws JSONException {
-        JSONObject json = new JSONObject();
+    public ObjectNode toJSON()  {
+
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode json = om.createObjectNode();
 
         json.put("node-id", nodeId.toString());
         populateCounters(json);
-        JSONArray tasks = new JSONArray();
+        ArrayNode tasks = om.createArrayNode();
         for (TaskProfile p : taskProfiles.values()) {
-            tasks.put(p.toJSON());
+            tasks.add(p.toJSON());
         }
-        json.put("tasks", tasks);
+        json.set("tasks", tasks);
 
         return json;
     }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/TaskProfile.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/TaskProfile.java
index a77c56f..680d2f9 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/TaskProfile.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/TaskProfile.java
@@ -25,10 +25,9 @@
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.hyracks.api.dataflow.TaskAttemptId;
 import org.apache.hyracks.api.partitions.PartitionId;
 import org.apache.hyracks.control.common.job.profiling.counters.MultiResolutionEventProfiler;
@@ -64,39 +63,41 @@
     }
 
     @Override
-    public JSONObject toJSON() throws JSONException {
-        JSONObject json = new JSONObject();
+    public ObjectNode toJSON()  {
+
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode json = om.createObjectNode();
 
         json.put("activity-id", taskAttemptId.getTaskId().getActivityId().toString());
         json.put("partition", taskAttemptId.getTaskId().getPartition());
         json.put("attempt", taskAttemptId.getAttempt());
         if (partitionSendProfile != null) {
-            JSONArray pspArray = new JSONArray();
+            ArrayNode pspArray = om.createArrayNode();
             for (PartitionProfile pp : partitionSendProfile.values()) {
-                JSONObject ppObj = new JSONObject();
+                ObjectNode ppObj = om.createObjectNode();
                 PartitionId pid = pp.getPartitionId();
-                JSONObject pidObj = new JSONObject();
-                pidObj.put("job-id", pid.getJobId());
-                pidObj.put("connector-id", pid.getConnectorDescriptorId());
+                ObjectNode pidObj = om.createObjectNode();
+                pidObj.put("job-id", pid.getJobId().toString());
+                pidObj.put("connector-id", pid.getConnectorDescriptorId().toString());
                 pidObj.put("sender-index", pid.getSenderIndex());
                 pidObj.put("receiver-index", pid.getReceiverIndex());
-                ppObj.put("partition-id", pidObj);
+                ppObj.set("partition-id", pidObj);
                 ppObj.put("open-time", pp.getOpenTime());
                 ppObj.put("close-time", pp.getCloseTime());
                 MultiResolutionEventProfiler samples = pp.getSamples();
                 ppObj.put("offset", samples.getOffset());
                 int resolution = samples.getResolution();
                 int sampleCount = samples.getCount();
-                JSONArray ftA = new JSONArray();
+                ArrayNode ftA = om.createArrayNode();
                 int[] ft = samples.getSamples();
                 for (int i = 0; i < sampleCount; ++i) {
-                    ftA.put(ft[i]);
+                    ftA.add(ft[i]);
                 }
-                ppObj.put("frame-times", ftA);
+                ppObj.set("frame-times", ftA);
                 ppObj.put("resolution", resolution);
-                pspArray.put(ppObj);
+                pspArray.add(ppObj);
             }
-            json.put("partition-send-profile", pspArray);
+            json.set("partition-send-profile", pspArray);
         }
         populateCounters(json);
 
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/logs/LogFile.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/logs/LogFile.java
index 8f95c35..c0f88eb 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/logs/LogFile.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/logs/LogFile.java
@@ -18,12 +18,12 @@
  */
 package org.apache.hyracks.control.common.logs;
 
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.PrintWriter;
 
-import org.json.JSONObject;
-
 public class LogFile {
     private final File root;
 
@@ -38,12 +38,12 @@
         openTime = System.currentTimeMillis();
     }
 
-    public synchronized void log(JSONObject object) throws Exception {
+    public synchronized void log(ObjectNode object) throws Exception {
         if (out == null) {
             root.mkdirs();
             out = new PrintWriter(new FileOutputStream(new File(root, openTime + ".log"), true));
         }
-        out.println(object.toString(1));
+        out.println(object.asText());
         out.flush();
     }
 
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/utils/ThreadDumpHelper.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/utils/ThreadDumpHelper.java
index eacb9e0..1d6dbcd 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/utils/ThreadDumpHelper.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/utils/ThreadDumpHelper.java
@@ -18,6 +18,13 @@
  */
 package org.apache.hyracks.control.common.utils;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import java.io.IOException;
 import java.lang.management.ThreadInfo;
 import java.lang.management.ThreadMXBean;
 import java.util.ArrayList;
@@ -26,15 +33,12 @@
 import java.util.List;
 import java.util.Map;
 
-import org.json.JSONException;
-import org.json.JSONObject;
-
 public class ThreadDumpHelper {
 
     private ThreadDumpHelper() {
     }
 
-    public static String takeDumpJSON(ThreadMXBean threadMXBean) throws JSONException {
+    public static String takeDumpJSON(ThreadMXBean threadMXBean) throws IOException {
         ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(true, true);
         List<Map<String, Object>> threads = new ArrayList<>();
 
@@ -69,18 +73,20 @@
             }
             threads.add(threadMap);
         }
-        JSONObject json = new JSONObject();
-        json.put("date", new Date());
-        json.put("threads", threads);
+        ObjectMapper om = new ObjectMapper();
+        ObjectNode json = om.createObjectNode();
+        json.put("date", new Date().toString());
+        json.putPOJO("threads", threads);
 
-        long [] deadlockedThreads = threadMXBean.findDeadlockedThreads();
-        long [] monitorDeadlockedThreads = threadMXBean.findMonitorDeadlockedThreads();
+        long[] deadlockedThreads = threadMXBean.findDeadlockedThreads();
+        long[] monitorDeadlockedThreads = threadMXBean.findMonitorDeadlockedThreads();
         if (deadlockedThreads != null && deadlockedThreads.length > 0) {
-            json.put("deadlocked_thread_ids", deadlockedThreads);
+            json.putPOJO("deadlocked_thread_ids", deadlockedThreads);
         }
         if (monitorDeadlockedThreads != null && monitorDeadlockedThreads.length > 0) {
-            json.put("monitor_deadlocked_thread_ids", monitorDeadlockedThreads);
+            json.putPOJO("monitor_deadlocked_thread_ids", monitorDeadlockedThreads);
         }
-        return json.toString();
+        om.enable(SerializationFeature.INDENT_OUTPUT);
+        return om.writerWithDefaultPrettyPrinter().writeValueAsString(json);
     }
 }
