The error you're encountering suggests a problem with session management in the context of using Hibernate Envers for auditing, particularly when the application attempts to perform operations that require access to session data which is not available. Here's a detailed approach to resolve the issue, focusing on understanding and fixing session management within the context of auditing with Hibernate Envers. Understanding the Error The error message indicates that the application failed to access session data or a defaultSessionRetriever during an audit operation. This typically occurs when there's a mismatch between the transaction/session lifecycle and the point at which Hibernate Envers tries to access session data for auditing purposes. Step-by-Step Solution Review Custom Revision Entity or Listener Configuration If you are using a custom revision entity or revision listener (as indicated by AuditTrailRevisionListener in the stack trace), ensure it's correctly implemented. A common issue is accessing session or transaction-bound resources outside the valid scope. Custom Revision Listener Example: If your AuditTrailRevisionListener implements RevisionListener , it should not directly access transaction-bound resources without ensuring they are available. public class AuditTrailRevisionListener implements RevisionListener { @Override public void newRevision (Object revisionEntity) { // Access session-bound resources carefully here } } Ensure Transaction Management The operation that triggers the audit must be within a transaction. Ensure methods that modify audited entities are annotated with @Transactional or programmatically managed transactions are correctly initiated and completed. @Transactional public void updateEntity (MyEntity entity) { repository.save(entity); } Session Management in Custom Services If SessionDataServiceImpl (mentioned in the stack trace) is part of your application and accesses session data, review its implementation. It should respect the transaction and session lifecycle, obtaining session data in a context-aware manner. Context-aware Session Data Access: Instead of directly accessing session data, consider injecting EntityManager and using it to access the current session indirectly, ensuring it aligns with the current transaction. @Autowired private EntityManager entityManager; public Session getCurrentSession () { return entityManager.unwrap(Session.class); } Integrate defaultSessionRetriever If the error suggests adding a defaultSessionRetriever , it implies your application requires a mechanism to fetch or create session data when not present. This might be specific to your application's architecture. Implementing a session retriever or ensuring that session data is always correctly initialized before your auditing logic runs may be necessary. // Pseudocode for a defaultSessionRetriever implementation public class DefaultSessionRetriever { public SessionData getSessionData () { // Logic to retrieve or create session data } } Review and Adjust Hibernate Envers Configuration Ensure your Hibernate Envers configuration aligns with your application's transaction and session management strategy. Check if there are any properties or configurations specific to Envers that might affect session data availability. Debugging and Logging Increase the logging level for both Spring transactions and Hibernate to get more insight into the transaction and session lifecycle. Look for any anomalies or unexpected behaviors around the time the error occurs. # application.properties logging.level.org.hibernate.envers=DEBUG logging.level.org.springframework.transaction=DEBUG Consult Documentation and Community If the issue persists, consult the Hibernate Envers and Spring documentation for any known issues or guidance on integrating Envers with custom session management strategies. Community forums and Stack Overflow can also be valuable resources for troubleshooting specific issues. Final Note Solving this issue requires a careful review of how your application manages transactions and sessions, especially in the context of auditing with Hibernate Envers. Since the exact solution depends on the specifics of your application's architecture and implementation, the steps provided here are intended to guide you through common areas to check and adjust.