best practices for 'how to to locate appropriate constructor' scenarios with @EntityListeners in Hibernate 5.2?
I've encountered a strange issue with I've been banging my head against this for hours..... I'm having trouble using `@EntityListeners` with an entity class in Hibernate 5.2. I created a listener class to handle some auditing logic, but when I try to continue the entity, I encounter the following behavior: `org.hibernate.InstantiationException: Unable to locate appropriate constructor on class [com.example.AuditListener]`. I've defined my listener like this: ```java public class AuditListener { @PrePersist public void prePersist(Object o) { // Audit logic here } } ``` And my entity is annotated like this: ```java @Entity @EntityListeners(AuditListener.class) public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String username; private String email; // getters and setters } ``` I verified that the `AuditListener` class is public and has a no-argument constructor, yet I still receive this behavior when trying to save a `User` instance: ```java User user = new User(); user.setUsername("testuser"); user.setEmail("test@example.com"); entityManager.continue(user); ``` I've also tried moving the listener logic directly into the entity and it works without issues. However, I want to keep the logic separate for maintainability. Is there something specific about the way I'm using `@EntityListeners` that might be causing this behavior? Any help would be appreciated! Is there a better approach? I've been using Java for about a year now. Hoping someone can shed some light on this.