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就好了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 SpringBoot 報 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapImportSelectorConfiguration': Initialization of bean failed; org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fundService': Injection of resource dependencies failed; Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configurationPropertiesBeans' defined in class path resource org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'catchFromPBomService': Cannot create inner bean '(inner bean)#302efb82' of type [com.thinkgem.jeesite.modules.fd 開發Spring過程中幾個常見異常(二):Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'a' define Spring AOP 報錯org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXXXX' defined in class path resource.......... 使用security報錯:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource ssm整合時出現 org.springframework.beans.factory.BeanCreationException :Error creating bean with name ‘XXX’ 異常的原因及解決方法
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM