tags:

views:

306

answers:

1

Envers looks easy. Just add some hibernate properties in your persistence.xml (eventlisteners), and annotate the entities you want to audit.

I am testing this on an application using Hibernate. Here is some pom info: - org.hibernate.hibernate-entitymanager:3.4.0.GA - org.hibernate.hibernate-annotations:3.4.0.GA - org.hibernate.hibernate:3.2.6.GA - org.jboss.envers.jboss-envers:1.2.1.GA-hibernate-3.3

If I insert NO annotations, my app context is loaded fine. But if I insert one, I am unable to build EntityManagerFactory. (...) Caused by: java.lang.NullPointerException at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateInheritanceMappingData(AuditMetadataGenerator.java:305) at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateFirstPass(AuditMetadataGenerator.java:353) at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:87) at org.hibernate.envers.configuration.AuditConfiguration.(AuditConfiguration.java:86) at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99) at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:260) at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198) at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181) at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)

Any help would be appreciated.

+1  A: 

org.jboss.envers.jboss-envers:1.2.1.GA-hibernate-3.3 works with hibernate-3.3 did you try to use newer version?

ziftech