树格分裂

Cannot resolve reference to bean 'mongoTemplate' while setting bean property 'mongoOperations'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with na

问题:

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

 

过程:

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

 

解决方法

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

posted on 2019-10-07 12:56  CaptainHook  阅读(2201)  评论(0编辑  收藏  举报

导航