close

[Solved] no String-argument constructor/factory method to deserialize from String value – Exception while deserializing json object from restTemplate

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error no String-argument constructor/factory method to deserialize from String value – Exception while deserializing json object from restTemplate in java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How no String-argument constructor/factory method to deserialize from String value – Exception while deserializing json object from restTemplate Error Occurs?

Today I get the following error no String-argument constructor/factory method to deserialize from String value – Exception while deserializing json object from restTemplate in java.

How To Solve no String-argument constructor/factory method to deserialize from String value – Exception while deserializing json object from restTemplate Error ?

  1. How To Solve no String-argument constructor/factory method to deserialize from String value – Exception while deserializing json object from restTemplate Error ?

    To Solve no String-argument constructor/factory method to deserialize from String value – Exception while deserializing json object from restTemplate Error I was using an ObjectMapper and was using convertValue instead of readValue.
    Posting here just to help anyone in the future.

  2. no String-argument constructor/factory method to deserialize from String value – Exception while deserializing json object from restTemplate

    To Solve no String-argument constructor/factory method to deserialize from String value – Exception while deserializing json object from restTemplate Error I was using an ObjectMapper and was using convertValue instead of readValue.
    Posting here just to help anyone in the future.

Solution 1

The code is correct but there’s a problem with the JSON. The address is a string and not a JSON object. For it to work, it would need to be something like:

"address": {"state": "LA", "country": "US"}

Without the outer quotes and the escape characters.

Solution 2

I was using an ObjectMapper and was using convertValue instead of readValue.

Posting here just to help anyone in the future.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment