当我只使用spirngdatajpa时,它工作得很好。但在我使用 JPA
以及 Elastic Search
,无法启动项目。错误如下:
**APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method jpaQueryFactory in com.ruowei.config.DatabaseConfiguration required a single bean, but 2 were found:
- org.springframework.orm.jpa.SharedEntityManagerCreator#0: defined by method 'createSharedEntityManager' in null
- org.springframework.orm.jpa.SharedEntityManagerCreator#1: defined by method 'createSharedEntityManager' in null
Action:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
Process finished with exit code 0**
我试过如何在spring启动应用程序的同一个域类上同时使用spring data jpa和spring data elasticsearch存储库?但还是不行。
我该怎么办?
暂无答案!
目前还没有任何答案,快来回答吧!