ok i solved the error i posted above Now i am havimng the same exact error as the OP and rafaelco. though i tried different forms of event lsiteners and still the same error.
I tried in hiberante.cfg.xml:
Code:
<event type="post-insert">
<listener
class="org.hibernate.envers.event.AuditEventListener" />
</event>
<event type="post-update">
<listener
class="org.hibernate.envers.event.AuditEventListener" />
</event>
<event type="post-delete">
<listener
class="org.hibernate.envers.event.AuditEventListener" />
</event> -->
<!-- needed to update the Eclipse Hibernate 3.0 dtd in order to recognise these collection events
<event type="pre-collection-update">
<listener
class="org.hibernate.envers.event.AuditEventListener" />
</event>
<event type="post-collection-recreate">
<listener
class="org.hibernate.envers.event.AuditEventListener" />
</event>
<event type="pre-collection-remove">
<listener
class="org.hibernate.envers.event.AuditEventListener" />
</event>
I tried in hibnernate.cfg.xml after removing the above ones:
Code:
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-insert"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-update"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-delete"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-update"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-remove"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-collection-recreate"/>
And also tried in sprin-config.xml becuase my sessionfactory is made in spring-config.xml:
Code:
<bean name="session-factory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
p:configLocation="classpath:hibernate.cfg.xml">
<property name="eventListeners">
<map>
<entry key="post-insert" value-ref="enversEventListener"/>
<entry key="post-update" value-ref="enversEventListener"/>
<entry key="post-delete" value-ref="enversEventListener"/>
<entry key="post-collection-recreate" value-ref="enversEventListener"/>
<entry key="pre-collection-remove" value-ref="enversEventListener"/>
<entry key="pre-collection-update" value-ref="enversEventListener"/>
</map>
</property>
<!-- <property name="entityInterceptor">
<bean class="com.illuminatics.losssharing.interceptor.AuditTrailInterceptor"/>
</property>-->
</bean>
<bean id="enversEventListener" class="org.hibernate.envers.event.AuditEventListener" />
i am still stuck that my envers does not fill the _aud tables and they remain empty. The original update goes through fine. My application is working fine but the history is not created in revinfo table Nor the _aud table.
I will appreciate if some one has gone through this issue and was able to solve this
Thanks in advance.
Syed