Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7700131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:38:15+00:00 2026-05-31T22:38:15+00:00

I am trying to parse the data into a class. But the problem is

  • 0

I am trying to parse the data into a class.

But the problem is that one of the values is in Json format.

Hence I am getting a MalformedJsonException.

This is the Json string:

{
    "name": "Check on Server Health ",
    "state": "ABORTED",
    "startTime": 1332962596131,
    "triggeredBy": "GUI_MANUAL",
    "completionPct": 25,
    "currentStep": "sayHello",
    "processDefId": "SW21SW",
    "jobRetries": 0,
    "businessKey": -1,
    "comments": "couldn't instantiate class com.mikewidgets.helloWorld.HelloWorldTask",
    "endTime": null,
    "status": "DELAY , ERR",
    "mtId": "MOTOROLA",
    "instParms": "{"message":"start-workflow","sender":"CLI_APP","receiver":"BPM_ENG","parameters":{"workflowId":"SW21SW","mikesname":"Mikeeeeeeey","wf_HostName":"localhost","triggeredBy":"GUI_MANUAL","replyQueue":"temp-queue: //ID: SW-Demo01-51605-1332362748085-0: 2246: 1"},"userId":"Ab","mtId":"MOTOROLA","messageType":"MESSAGE_MSG"}",
    "execId": "292",
    "startUserId": "Ab"
  }

This is the bean class I am using:

import com.google.gson.JsonElement;

public class WfActive {

private String name;
private String state;
private String startTime;
private String status;
private String endTime;
private String comments;
private String triggeredBy;
private String execId;
private JsonElement instParms;
private String startUserId;
private String mtId;
private String businessKey;
private String completionPct;
private String jobRetries;
private String processDefId;
private String currentStep;

public String getName() {
    return name;
}
public void setName(String name) {
    this.name = name;
}
public String getState() {
    return state;
}
public void setState(String state) {
    this.state = state;
}
public String getStartTime() {
    return startTime;
}
public void setStartTime(String startTime) {
    this.startTime = startTime;
}
public String getStatus() {
    return status;
}
public void setStatus(String status) {
    this.status = status;
}
public String getEndTime() {
    return endTime;
}
public void setEndTime(String endTime) {
    this.endTime = endTime;
}
public String getComments() {
    return comments;
}
public void setComments(String comments) {
    this.comments = comments;
}
public String getTriggeredBy() {
    return triggeredBy;
}
public void setTriggeredBy(String triggeredBy) {
    this.triggeredBy = triggeredBy;
}
public String getExecId() {
    return execId;
}
public void setExecId(String execId) {
    this.execId = execId;
}
public JsonElement getInstParms() {
    return instParms;
}
public void setInstParms(JsonElement instParms) {
    this.instParms = instParms;
}
public String getStartUserId() {
    return startUserId;
}
public void setStartUserId(String startUserId) {
    this.startUserId = startUserId;
}
public String getMtId() {
    return mtId;
}
public void setMtId(String mtId) {
    this.mtId = mtId;
}
public String getBusinessKey() {
    return businessKey;
}
public void setBusinessKey(String businessKey) {
    this.businessKey = businessKey;
}
public String getCompletionPct() {
    return completionPct;
}
public void setCompletionPct(String completionPct) {
    this.completionPct = completionPct;
}
public String getJobRetries() {
    return jobRetries;
}
public void setJobRetries(String jobRetries) {
    this.jobRetries = jobRetries;
}
public String getProcessDefId() {
    return processDefId;
}
public void setProcessDefId(String processDefId) {
    this.processDefId = processDefId;
}
public String getCurrentStep() {
    return currentStep;
}
public void setCurrentStep(String currentStep) {
    this.currentStep = currentStep;
}

}

But I am getting a Malformed exception at :

LA","instParms":"{"message":"start-workf // this is inside instParms

What is my mistake and how do I correct it?

Please forgive the big code, the interesting part is “instParms”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:38:16+00:00Added an answer on May 31, 2026 at 10:38 pm

    Your JSON data is malformed (middle line below):

    "mtId": "MOTOROLA",
    "instParms": "{"message":"start-workflow","sender":"CLI_APP","receiver":"BPM_ENG","parameters":{"workflowId":"SW21SW","mikesname":"Mikeeeeeeey","wf_HostName":"localhost","triggeredBy":"GUI_MANUAL","replyQueue":"temp-queue: //ID: SW-Demo01-51605-1332362748085-0: 2246: 1"},"userId":"Ab","mtId":"MOTOROLA","messageType":"MESSAGE_MSG"}",
    "execId": "292",
    

    Second double quote in the value of instParms should be escaped. Alternatively, one could use single quotes instead if you know that single quotes aren’t used in the value.

    This is valid:

    "mtId": "MOTOROLA",
    "instParms": '{"message":"start-workflow","sender":"CLI_APP","receiver":"BPM_ENG","parameters":{"workflowId":"SW21SW","mikesname":"Mikeeeeeeey","wf_HostName":"localhost","triggeredBy":"GUI_MANUAL","replyQueue":"temp-queue: //ID: SW-Demo01-51605-1332362748085-0: 2246: 1"},"userId":"Ab","mtId":"MOTOROLA","messageType":"MESSAGE_MSG"}',
    "execId": "292",
    

    and so is this:

    "mtId": "MOTOROLA",
    "instParms": "{\"message\":\"start-workflow\",\"sender\":\"CLI_APP\",\"receiver\":\"BPM_ENG\",\"parameters\":{\"workflowId\":\"SW21SW\",\"mikesname\":\"Mikeeeeeeey\",\"wf_HostName\":\"localhost\",\"triggeredBy\":\"GUI_MANUAL\",\"replyQueue\":\"temp-queue: //ID: SW-Demo01-51605-1332362748085-0: 2246: 1\"},\"userId\":\"Ab\",\"mtId\":\"MOTOROLA\",\"messageType\":\"MESSAGE_MSG\"}",
    "execId": "292",
    

    Another alternative would be to embed the value of instParms as a subobject rather than a stirng:

    "mtId": "MOTOROLA",
    "instParms": {
        "message": "start-workflow",
        "sender": "CLI_APP",
        "receiver": "BPM_ENG",
        "parameters": {
            "workflowId": "SW21SW",
            "mikesname": "Mikeeeeeeey",
            "wf_HostName":"localhost",
            "triggeredBy":"GUI_MANUAL",
            "replyQueue":"temp-queue: //ID: SW-Demo01-51605-1332362748085-0: 2246: 1"
        },
        "userId": "Ab",
        "mtId": "MOTOROLA",
        "messageType": "MESSAGE_MSG"
    },
    "execId": "292",
    

    This is arguably the best solution (unless there is some other compelling reason to keep the string representation).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse the output from a tool into a data structure but
I have been trying to parse Json into A ListView but when i do
I am trying to parse a CSV file containing some data, mostly numeral but
I am trying to parse out data from oodle.com api feed using the JSON.NET
http://pastebin.com/rXbeKqAa Hi all I have been trying to parse the above JSON into a
I am trying to make an app that parses data from Twitter using JSON
I am trying to parse JSON file generated from ColdFusion server in SerializeJSON format.
I'm trying to deserialize some JSON data into objects for an application. Up until
I am trying to parse a data file in ANTLR - it has optional
I'm trying to parse some data returned by a 3rd party app (a TSV

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.