No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 2
问题 I am defining two EntityManager beans for two different databases. Each EntityManager bean refers to a unique, respective <persistence-unit/> defined in persistence.xml . The same code and config worked fine with Spring 2.x. When I upgrade to Spring 3, I see the following exception while deploying the app in the server: Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean