nazeer
Jul 29th, 2011, 11:19 AM
I am using
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.0.0.M1</version>
</dependency>
I want to know how to tell <jpa:repositories> to use SharedEntityManagerBean?
I have multiple jar's with different persistence units
and at the time of autowire repo's it would fail saying "No unique bean EntityManagerFactory" : Exception given below
------------------------------------------------
org.springframework.beans.factory.NoSuchBeanDefini tionException: No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 2
at org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor.findDefaultEntityManagerF actory(PersistenceAnnotationBeanPostProcessor.java :536)
at org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor.findEntityManagerFactory( PersistenceAnnotationBeanPostProcessor.java:495)
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.0.0.M1</version>
</dependency>
I want to know how to tell <jpa:repositories> to use SharedEntityManagerBean?
I have multiple jar's with different persistence units
and at the time of autowire repo's it would fail saying "No unique bean EntityManagerFactory" : Exception given below
------------------------------------------------
org.springframework.beans.factory.NoSuchBeanDefini tionException: No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 2
at org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor.findDefaultEntityManagerF actory(PersistenceAnnotationBeanPostProcessor.java :536)
at org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor.findEntityManagerFactory( PersistenceAnnotationBeanPostProcessor.java:495)