我正在升级我的spring数据库。这是我的Spring数据版本:
<org.springframework.data.jpa-version>
1.11.6.RELEASE
</org.springframework.data.jpa-version>
<org.springframework.data.mongodb-version>
1.10.6.RELEASE
</org.springframework.data.mongodb-version>
我得到
java.lang.NoSuchMethodError初始化mongo存储库时: 引起原因:org.springframework.beans.factory.BeanCreationException: 创建名称为“ eventRepository”的Bean时出错:Bean实例化 通过构造函数失败;嵌套异常为 org.springframework.beans.BeanInstantiationException:失败 实例化 [com.plantronics.platform.core.repository.mongodb.events.support.EventRepositoryFactoryBean]: 构造函数抛出异常;嵌套异常为 java.lang.NoSuchMethodError: org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean: 在以下位置找不到方法(Ljava / lang / Class;)V org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:275) 〜[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
@Repository
@EventRepositorySupport
public interface EventRepository extends GenericMongoRepository<CsEvent, String> {
}
public class EventRepositoryFactoryBean<R extends MongoRepository<T, ID>, T, ID extends Serializable> extends
MongoRepositoryFactoryBean<R, T, ID> {
public EventRepositoryFactoryBean(Class<? extends R> repositoryInterface) {
super(repositoryInterface);
// TODO Auto-generated constructor stub
}
@Override
protected RepositoryFactorySupport getFactoryInstance(MongoOperations mongoOperations) {
return new EventRepositoryFactory<T, ID>(mongoOperations);
}