当前位置:   article > 正文

‘org.springframework.data.mongodb.core.convert.MappingMongoConverter‘ that could not be found._required a bean of type 'org.springframework.data.

required a bean of type 'org.springframework.data.mongodb.core.mongotemplate

报错

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of constructor in org.springframework.data.mongodb.config.MongoAuditingRegistrar$MongoMappingContextLookup required a bean of type 'org.springframework.data.mongodb.core.convert.MappingMongoConverter' that could not be found.

The following candidates were found but could not be injected:
	- Bean method 'mappingMongoConverter' in 'MongoReactiveDataAutoConfiguration' not loaded because @ConditionalOnClass did not find required class 'com.mongodb.reactivestreams.client.MongoClient'


Action:

Consider revisiting the entries above or defining a bean of type 'org.springframework.data.mongodb.core.convert.MappingMongoConverter' in your configuration.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

原因

  • @EnableMongoAuditing 配置2个以上,只保留一个即可
@EnableMongoAuditing //重点删除这个
@Configuration
public class MongoConfig {

}
  • 1
  • 2
  • 3
  • 4
  • 5

解决

  • 删掉这个配置类
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/125770
推荐阅读
相关标签
  

闽ICP备14008679号