Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Error while parsing JSON response in Connect-REST



When trying to parse an incoming JSON response to a Connect-REST rule, it fails with the following error.

Error Messages

** Error mapping incoming response to .response_POST: com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [map type; class java.util.LinkedHashMap, [simple type, class java.lang.Object] -> [simple type, class java.lang.Object]] from String value ('["Username: username is already being used."]'); no single-String constructor/factory method
at [Source: "[\"Username: username is already being used.\"]"; line: 1, column: 1]

Steps to Reproduce

1. Create Connect-REST using POST method.
2. Configure Connect-REST request and response tab with JSON mapping.
3. Map the request to clipboard.
4. Run the Connect-REST.

Root Cause

A third-party product issue. Users external REST Service is sending a non RFC 4627 compliant JSON String.


Here’s the explanation for the reported behavior:

Pega uses third-party (fasterxml) JSON Data binding java API (jackson-databind.jar) to map JSON formatted strings to / from Clipboard.

The version of Jackson Databind API bundled with Pega 7.2.2 is 2.7.4. The JSON types implemented by version Jackson-databind-2.7.4.jar is RFC 4627.

To resolve this issue, one must capture the raw response string into a “Text” property mapped to the Clipboard.

Then use parsing logic to extract the required text into corresponding / appropriate Clipboard property(ies).

Published August 16, 2017 - Updated October 8, 2020

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us