Can not deserialize value of type int from String

We Are Going To Discuss About Can not deserialize value of type int from String. So lets Start this Java Article.

Can not deserialize value of type int from String

  1. Can not deserialize value of type int from String

    I would suggest altering your AddToCartPojo so that productId is a String instead of an int:
    So change this :
    private int productId;
    To this :
    private String productId;

  2. Can not deserialize value of type int from String

    I would suggest altering your AddToCartPojo so that productId is a String instead of an int:
    So change this :
    private int productId;
    To this :
    private String productId;

Solution 1

I would suggest altering your AddToCartPojo so that productId is a String instead of an int:

So change this :

private int productId;

To this :

private String productId;

You’ll need to change your getters ‘n’ setters too.

Original Author Tom Mac Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment