I am trying to configure a test for hibernate 4.3 with JPA and Spring 4 using the following config:
<bean id="em" class="LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" /> </property> <property name="persistenceXmlLocation" value="classpath:integrations/hibernate4/jpa/persistence.xml" /> </bean> Now the persistence config looks as follows:
<persistence-unit name="test" > <class>hibernate4.jpa.JpaEntity</class> <class>hibernate4.jpa.JpaHiLoEntity</class> <properties> <property name="hibernate.hbm2ddl.auto" value="create" /> </properties> <exclude-unlisted-classes>true</exclude-unlisted-classes> </persistence-unit> If I run the above with hibernate 4.2.4 everything runs fine, however with 4.3 the above setup loads ALL hbm.xml resource files, some of which refer to classes that are not present on the classpath, causing ClassNotFoundException.
Does anyone know what the reason for the changed behavior is and how to stop hibernate from scanning for hbm.xml files (packagesToScan property did not work either)?
|