Announcement Announcement Module
No announcement yet.
Spring Data Auditing: cannot make AuditingEntityListener Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data Auditing: cannot make AuditingEntityListener

    I'm trying to configure the spring data jpa auditing functionality on my project (Hibernate 4.1.6, hibernate-jpa 2.0, spring-data-jpa 1.1.0, spring 3.1.2) but I'm not able to make it work.

    I think the problem is that I'm not able to register the AuditingEntityListener but I'm not sure. I tried to set a breakpoint in all its methods but they never gets called including the afterPropertiesSet.

    Since I don't have a persistence.xml file I tried to use the new mappingResources property of LocalContainerEntityManagerFactoryBean (

    This is from my context.xml:

    <jpa:repositories base-package="package.domain" />
    <jpa:auditing auditor-aware-ref="auditorAware" />
    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    	<property name="dataSource" ref="dataSource" />
    	<property name="packagesToScan" value="package.domain.model" />
    	<property name="mappingResources">
    	<property name="jpaVendorAdapter">
    		<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
    	<property name="jpaProperties">
    <context:annotation-config />
    This is the contento of the "package/domain/domain-orm.xml" in my classpath:
    <?xml version="1.0" encoding="UTF-8"?>
    <entity-mappings xmlns="" xmlns:xsi=""
    	xsi:schemaLocation=" orm_2_0.xsd" version="2.0">
    				<entity-listener class="" />
    It seems to me that the domain-orm.xml file is completely ignored: i tried to put errors in this file (invalid xml, wrong class name) and nothing happens.

    Any suggestion on what to check is welcome


  • #2
    Solved: it was a small typo in the file name (a traling quote that shouldn't be there).