#How to fix Error:JSON parse error: Already had POJO for id (java.lang.Long)

1 messages · Page 1 of 1 (latest)

eager relic
#

Hello everyone,

I'm working with a @ManyToMany relationship between two tables: Product and ProductNote. The relationship seems to be set up correctly, but I'm running into issues when trying to save a ProductNote to an existing Product.

Here’s what happens:

I get an error when trying to add a ProductNote to a Product that already has the same ProductNote.
To handle serialization, I tried using @JsonIdentityInfo and @JsonBackReference, but I still encounter errors.
The error message I’m now getting is: Content type 'application/json;charset=UTF-8' not supported.
I’ve searched for solutions but haven’t found anything that resolves both the circular reference issue and the Content-Type error.

faint vaporBOT
#

<@&1004656351647117403> please have a look, thanks.

old arrow
#

what's the exception with stacktrace? 😄

royal geyser
#

You shouldn't use your entities for your DTOs. And can you share your controller?