This question seems to be the same as this No serializer found for class org.hibernate.proxy.pojo.javassist.Javassist?. But there are some differences. The author of that question has lazy relationships. Instead, my entity is so simple:
@Entity
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Length(min = 5, max = 50, message = "error.firstName.length")
@Column(name = "first_name")
private String firstName;
@Length(min = 5, max = 50, message = "error.lastName.length")
@Column(name = "last_name")
private String lastName;
public User(Long id, String firstName, String lastName) {
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
}
public User(String firstName, String lastName) {
this(null, firstName, lastName);
}
public User() {}
// getters & setters
}
but I still get this error:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: ua.savenkodenys.user_management.persistence.entity.User_$$_jvst11c_0["handler"]) (in the error description)
I also want to know what is this - (through reference chain: ua.savenkodenys.user_management.persistence.entity.User_$$_jvst11c_0["handler"]) (in the error description).
ua.savenkodenys.user_management.persistence.entity - these are my packages