简体   繁体   中英

Hibernate Envers Audit Listeners are not registered even though entity are Annotated with @Audit

I have Spring4.1.2, Hibernate 4.2.18, Jboss 6 application. I have configured entities and a custom revision entity. But still Envers listeners are not registered to listenerRegistry.

I tried to debug the enverse source and found that source [EnversIntegrator.integrate method] is skipping listeners as it could not find any audit tables.

I also found the root cause also. when I dig into deeper, this code 'clazz.getAnnotation(Audited.class)' inside AnnotationsMetaDataReader.getDefaultAudited method always returns null. I am sure that Audited annotation is present in entity class.

This seems to be strange as it is working perfectly for another sample application.

This seems to be a class load issue. Please ensure that required envers are in place.

Is your application uses Jboss module 'org.hibernate' instead of hibernate jars in War? if so, configure jboss module 'org.hibernate.envers' in your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM