0

I try to configure springdata with embedded-database. Context file inspired from http://cooldevstuff.wordpress.com/2012/09/20/in-memory-database-using-spring-3-2/

My context file:

    <jdbc:embedded-database id="embeddedDataSource">
    <jdbc:script location="classpath:schemaFile.sql" />
    <jdbc:script location="classpath:dataFile.sql" />
    </jdbc:embedded-database>

<jpa:repositories base-package="aa.bb.repository" />

<bean class="org.springframework.orm.hibernate4.HibernateExceptionTranslator" />

<bean id="entityManagerFactory">
    <property name="dataSource" ref="embeddedDataSource" />
    <property name="persistenceUnitName" value="SamplePU"></property>
</bean>

but I get error: No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 0.

what I missed?

user1055201
  • 159
  • 7
  • 16

1 Answers1

0

The configuration is just invalid. Your bean entityManagerFactory does not declare any class attribute.

Oliver Drotbohm
  • 80,157
  • 18
  • 225
  • 211