当前位置: 移动技术网 > IT编程>开发语言>Java > Cannot resolve reference to bean 'mongoTemplate' while setting bean property 'mongoOperations'; nested exception is org.springframewor

Cannot resolve reference to bean 'mongoTemplate' while setting bean property 'mongoOperations'; nested exception is org.springframewor

2019年10月07日  | 移动技术网IT编程  | 我要评论

问题:

springboot 启动时出错,报没法创建bean的错误,看到nested最后是关于mongotemplate的错误。

 

过程:

看网上大多说的是修改mongotemplate的配置,但是springboot自动注入我都没有配置,还有的说是注解没有写比如@service @autowired等,检查了一下都对啊

 

解决方法

我之前运行的时候都挺好的啊,找了半天,才发现之前更新了一下  spring-data-mongodb依赖  从2.1.6到2.2.0 ,应该是兼容的问题,回退到2.1.6就好了。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网