Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a JSONArray Serialization issue for Spring MVC #1067

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public Response cassInfo() throws JSONException {
return Response.status(503).entity("JMXConnectionException").build();
}
logger.debug("node tool info being called");
return Response.ok(nodeTool.info(), MediaType.APPLICATION_JSON).build();
return Response.ok(nodeTool.info().toString(), MediaType.APPLICATION_JSON).build();
}

@GET
Expand All @@ -139,7 +139,7 @@ public Response cassRing(@PathParam("id") String keyspace) throws JSONException
return Response.status(503).entity("JMXConnectionException").build();
}
logger.debug("node tool ring being called");
return Response.ok(nodeTool.ring(keyspace), MediaType.APPLICATION_JSON).build();
return Response.ok(nodeTool.ring(keyspace).toString(), MediaType.APPLICATION_JSON).build();
}

@GET
Expand All @@ -152,7 +152,8 @@ public Response statusInfo() throws JSONException {
return Response.status(503).entity("JMXConnectionException").build();
}
logger.debug("node tool status being called");
return Response.ok(nodeTool.statusInformation(), MediaType.APPLICATION_JSON).build();
return Response.ok(nodeTool.statusInformation().toString(), MediaType.APPLICATION_JSON)
.build();
}

@GET
Expand All @@ -163,15 +164,15 @@ public Response cassFlush() {
try {
flush.execute();
rootObj.put("Flushed", true);
return Response.ok().entity(rootObj).build();
return Response.ok().entity(rootObj.toString()).build();
} catch (Exception e) {
try {
rootObj.put("status", "ERROR");
rootObj.put("desc", e.getLocalizedMessage());
} catch (Exception e1) {
return Response.status(503).entity("FlushError").build();
}
return Response.status(503).entity(rootObj).build();
return Response.status(503).entity(rootObj.toString()).build();
}
}

Expand All @@ -183,15 +184,15 @@ public Response cassCompact() {
try {
compaction.execute();
rootObj.put("Compacted", true);
return Response.ok().entity(rootObj).build();
return Response.ok().entity(rootObj.toString()).build();
} catch (Exception e) {
try {
rootObj.put("status", "ERROR");
rootObj.put("desc", e.getLocalizedMessage());
} catch (Exception e1) {
return Response.status(503).entity("CompactionError").build();
}
return Response.status(503).entity(rootObj).build();
return Response.status(503).entity(rootObj.toString()).build();
}
}

Expand Down Expand Up @@ -237,7 +238,7 @@ public Response version() {
return Response.status(503).entity("JMXConnectionException").build();
}
return Response.ok(
new JSONArray().put(nodeTool.getReleaseVersion()),
new JSONArray().put(nodeTool.getReleaseVersion()).toString(),
MediaType.APPLICATION_JSON)
.build();
}
Expand Down Expand Up @@ -309,7 +310,8 @@ public Response statusthrift() throws JSONException {
"status",
(nodeTool.isThriftServerRunning()
? "running"
: "not running")),
: "not running"))
.toString(),
MediaType.APPLICATION_JSON)
.build();
}
Expand Down
Loading