If I configuer  my AuditListener in the hibernate.cfg.xml file like this

<listener type="pre-insert" class="net.weissboeck.gimmo.entities.AuditListener"/>

im getting the following error after first acces to database:

[ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Exception constructing service 'ValueEncoderSource': Error invoking service builder method org .apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, InvalidationEventHub) (at TapestryModule.java:1910) (for service 'ValueEncoderSource'): Error invoking service contribution method org .apache .tapestry5 .hibernate .HibernateModule.contributeValueEncoderSource(MappedConfiguration, boolean, HibernateSessionSource, Session, TypeCoercer, PropertyAccess, LoggerSource): Exception constructing service 'HibernateSessionSource': Error invoking service builder method org .apache .tapestry5 .hibernate.HibernateCoreModule.buildHibernateSessionSource(Logger, List, RegistryShutdownHub) (at HibernateCoreModule.java:123) (for service 'HibernateSessionSource'): Unable to instantiate specified event (pre-insert) listener class: net.weissboeck.gimmo.entities.AuditListener

Debugging seems to indicate a problem with the classloader.

Has anyone got hibernate listeners working with T5 hibernate module?

This is my AuditListener class (I use a common abstract base entity with alle the technical and audit data for all my entities)

package net.weissboeck.gimmo.entities;

import java.util.Date;

import org.hibernate.event.PreUpdateEvent;
import org.hibernate.event.PreUpdateEventListener;

public class AuditListener implements PreUpdateEventListener {

        private static final long serialVersionUID = 1L;
        
        @Override
        public boolean onPreUpdate(PreUpdateEvent pEvent) {
                AbstractBaseEntity entity = (AbstractBaseEntity) 
pEvent.getEntity();
                entity.setLastUpdated(new Date());
                return false;
        }
}




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to