top of page
hand-businesswoman-touching-hand-artificial-intelligence-meaning-technology-connection-go-

An Error that surprised !


This is a REST API developed in Java-SpringBoot.

I had to take over my friends work and i was getting this error.

org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class com.numpyninja.dietician.dto.JwtResponseDTO] with preset Content-Type 'null'


Everything seemed Ok.

When I had to dig into JwtResponseDTO, realized that getter, setters, constructors were missing.

We use lombok to generate these. And my friend missed to add lombok annotations.

Added those and error was gone :-)




missing to add constructor, getter , setter is a common mistake which we should try to avoid.

Happy coding!.

Thank you, leave your comments if any.



154 views1 comment

1 Comment

Rated 0 out of 5 stars.
No ratings yet

Add a rating
Guest
Aug 24, 2023
Rated 5 out of 5 stars.

Nice

Like
bottom of page