To avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS || Springboot || Error Rectify

Опубликовано: 07 Август 2026
на канале: TECHOX
5,301
41

Getting Error in REST API
"Get by Id "

Error: to avoid the exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS

Get output like this:
{
"timestamp": "2021-05-02T23:10:14.251+00:00",
"status": 500,
"error": "Internal Server Error",
"message": "",
"path": "/courses/146"
}

Solution : Use this annotation in your Entity Class:
@JsonIgnoreProperties(value= {"handler","hibernateLazyInitializer","FieldHandler"})
#springboot #json #disable #SerializationFeature #disableSerializationFeature #FAIL_ON_EMPTY_BEANS