The method toJSONObject(String) in the type XML is not applicable for the arguments (String, boolean)

Solution In Progress - Updated -

Issue

I created my own WorkItemHandler to return a JSON String even if the API has returned a XML string. To convert the xml string to JSON I use the package org.json (it is a maven dependency) and the code:

JSONObject xmlJSONObj = XML.toJSONObject(content, true);  
jsonString = xmlJSONObj.toString(0);

This works when I run it on Eclipse but I can't build the project on JBoss BPM Suite. It says "The method toJSONObject(String) in the type XML is not applicable for the arguments (String, boolean)".

Do you already have a default class XML that is overriding the org.json.XML class?

Environment

Red Hat JBoss BPM Suite 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content