I am trying to use both spring data solr and spring data mongo in a Java EE project. Problem is both
and
try to inject MongoOperations and SolrOperations to the Repository. Afterwards both create repositories and then I end up with an ambiguous cdi dependency exception. Looking at the source code here
there does not seem to be a way to distinguish between solr repositories and mongo repositories. Is there any solution?
I am facing the same problems with spring data neo4j and spring data mongo.
The current implementation of afterBeanDiscovery() in CdiRepositoryExtensionSupport.java create bean instance for all repositories. When you use more than one Spring-Data-xxx there are multiple bean references in the context and ambigous name exception occur.
In order to make it work i do:
After...it works!
Maybe it is not the best way to solve this issue and the guys at Spring Data project can find a better solution
CdiRepositoryExtensionSupport.java
Repository
Hope this help!