Reputation: 24334
I'm trying to set up a basic Spring MVC app with MongoDB intergration. Using Java 7 JDK
However when trying to build the project with Maven I am seeing a compilation error as follows:
[ERROR] \workspace\apache-analyser\src\main\java\com\apache\analyser\repository\RequestRepository.java:[7,7]
error: name clash: <S>save(Iterable<S>) in CrudRepository and save(Iterable<? extends T#2>) in MongoRepository have the same erasure, yet neither overrides the other
Here is the Repository interface:
package com.apache.analyser.repository;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.apache.analyser.domain.Request;
public interface RequestRepository extends MongoRepository<Request, String> {
}
And the Spring configuration to initialise this:
<mongo:repositories base-package="com.apache.analyser.repository" />
It seems like a basic setup I am trying to do so not sure why I am seeing this error. Has anyone seen this or is aware of why this might happen?
Upvotes: 0
Views: 928
Reputation: 11
I solved my problem by changing spring-data-commons-core version from 1.3.1 to 1.2.1. This last one is used with spring-data-mongodb 1.0.3.
Upvotes: 1
Reputation: 24334
I have solved my issue by reverting to Java 6 JDK. I am not sure why this is not working with Java7 so if anyone is aware It'd be great to hear!
Upvotes: 0