Json mapping error for Spring boot

Asked

Viewed 79 times

1

I’m getting the below msg when trying to map a json -- Spring Boot

Jsonmappingexception: Can not Construct instance of javax.servlet.http.Httpservletrequest: Abstract types either need to be Mapped to Concrete types

In the product class I added the information below(although the class is not Abstract) and it did not work @Jsondeserialize(as=Product.class)

BufferedReader reader = Request.getReader();        
Gson gson = new Gson();     
Produto produtos =  gson.fromJson(reader, Produto.class);

Note:Request is an Httpservletrequest

  • Could put the declaration of the Product class also?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.