国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

SpringBoot項目啟動報錯:Injection of resource dependencies failed; nested exception is org.springframework

這篇具有很好參考價值的文章主要介紹了SpringBoot項目啟動報錯:Injection of resource dependencies failed; nested exception is org.springframework。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

bean注入失敗,報錯如下:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AAAImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BBBImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'FFFImpl': Unsatisfied dependency expressed through field 'nnService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [XXXService] from ClassLoader [sun.misc.Launcher$AppClassLoader@58644d46]
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:332)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$246/2091160281.getObject(Unknown Source)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:544)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:520)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:673)
	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:228)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:329)
	... 87 more
  1. 檢查最后一行報錯的XXXService,里面注入的service類,是否互相注入
  2. 檢查注入的對象名是否為類名一致(首字母小寫)
    只使用@Autowired時,需要保證注解的對象名和注解類名一致,
    注意: 首字母要小寫,且注解時沒有命名

解決:
方法1:優(yōu)化代碼,去掉互相注入的情況
方法2:使用注解,@Lazy(true)文章來源地址http://www.zghlxwxcb.cn/news/detail-853308.html

到了這里,關(guān)于SpringBoot項目啟動報錯:Injection of resource dependencies failed; nested exception is org.springframework的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔相關(guān)法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • Injection of autowired dependencies failed; nested exception is java.lang.Il

    ? 今天在學(xué)習(xí)nacos統(tǒng)一配置管理時,使用了@value注解,用來注入nacos中的配置屬性,發(fā)現(xiàn)讀取不到,代碼如下: 啟動服務(wù)時發(fā)現(xiàn)報以下錯誤: 經(jīng)過多方面檢查,發(fā)現(xiàn)是環(huán)境問題,我bootstrap.yml中寫給我的統(tǒng)一配置管理配置的是dev開發(fā)環(huán)境,配置如下: 而我的服務(wù)沒有配置為開發(fā)環(huán)

    2024年02月07日
    瀏覽(22)
  • SpringBoot啟動項目報錯: Consider defining a bean of type ‘xxx‘ in your configuration.

    原因:涉及這類bean問題的報錯,大多數(shù)導(dǎo)致原因為對應(yīng)的bean類或bean名未注入容器 檢查思路或解決辦法: 1.根據(jù)提示信息里的bean名稱和找不到的類名,檢查該類是否具有把該類以報錯bean名注入容器的操作,如沒有添加注解或者xml文件注入容器,然后再去啟動檢查是否可以啟

    2024年04月10日
    瀏覽(25)
  • Spring6-IoC(Inversion of Control)控制反轉(zhuǎn)和DI(Dependency Injection)依賴注入,手動實現(xiàn)IOC

    Java 反射機制是在運行狀態(tài)中,對于任意一個類,都能夠知道這個類的所有屬性和方法;對于任意一個對象,都能夠調(diào)用它的任意方法和屬性;這種動態(tài)獲取信息以及動態(tài)調(diào)用對象方法的功能稱為 Java 語言的 反射機制 。簡單來說, 反射機制指的是程序在運行時能夠獲取自身

    2024年02月09日
    瀏覽(43)
  • SpringBoot中循環(huán)依賴報錯解決---The dependencies of some of the beans in the application context form a cycle

    SpringBoot中循環(huán)依賴報錯解決---The dependencies of some of the beans in the application context form a cycle

    循環(huán)依賴: 循環(huán)依賴就是循環(huán)引用,也就是兩個或則兩個以上的bean互相依賴對方,形成閉環(huán)。比如A類中有B屬性,B類中有A屬性 一、報錯信息 The dependencies of some of the beans in the application context form a cycle: ?二、解決方案 1、修改配置文件 根據(jù)Action中的提示 不鼓勵依賴循環(huán)引用

    2024年02月11日
    瀏覽(26)
  • 解決Springboot項目打成jar包后獲取resources目錄下的文件報錯的問題

    解決Springboot項目打成jar包后獲取resources目錄下的文件報錯的問題

    前幾天在項目讀取resources目錄下的文件時碰到一個小坑,明明在本地是可以正常運行的,但是一發(fā)到測試環(huán)境就報錯了,說找不到文件,報錯信息是:class path resource [xxxx] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:xxxx.jar!/BOOT-INF/classes!xxxx。 看了

    2024年02月11日
    瀏覽(22)
  • IDEA項目啟動報錯:Failed to execute goal on project xxx: Could not resolve dependencies for project

    IDEA項目啟動報錯:Failed to execute goal on project xxx: Could not resolve dependencies for project

    [ERROR] Failed to execute goal on project xxx: Could not resolve dependencies for project Failed to collect dependencies at xxx .xxx-service:jar:dev: Failed to read artifact descriptor for xxxx/maven-snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of nexus-snaps

    2024年02月03日
    瀏覽(247)
  • vue 啟動項目報錯Cannot read properties of undefined (reading ‘parseComponent‘)

    如果出現(xiàn)如下報錯大概率是因為install時中途出現(xiàn)異常導(dǎo)致vue-template-compiler依賴沒有正常安裝導(dǎo)致的,重新安裝即可 1、 yarn add vue-template-compiler 或 npm add vue-template-compiler 2、最后如果還是不行就再用 yarn upgrade –latest vue-template-compiler npm upgrade –latest vue-template-compiler

    2024年02月12日
    瀏覽(24)
  • vue 啟動項目報錯:TypeError: Cannot set property ‘parent‘ of undefined異常解決

    vue 啟動項目報錯:TypeError: Cannot set property ‘parent‘ of undefined異常解決

    場景:從git上面拉下來一個項目 npm i 下載完依賴以后 npm run serve 去運行項目的時候 報錯TypeError: Cannot set property ‘parent’ of undefined 如圖所示 原因:首先排查發(fā)現(xiàn)判斷得出是less解析失敗導(dǎo)致 但是經(jīng)過長時間的查詢解決方案發(fā)現(xiàn)是因為vue版本在下載包的過程中由2.6.10升級為2

    2024年02月12日
    瀏覽(26)
  • 什么是依賴注入(Dependency Injection)?

    依賴注入(Dependency Injection,簡稱DI)是一種設(shè)計模式,用于實現(xiàn)類之間的解耦和依賴關(guān)系的管理。它通過將依賴關(guān)系的創(chuàng)建和維護責任轉(zhuǎn)移到外部容器中,使得類不需要自己實例化依賴對象,而是由外部容器動態(tài)地注入依賴。 傳統(tǒng)的對象創(chuàng)建方式往往由類自身負責創(chuàng)建和管

    2024年02月15日
    瀏覽(16)
  • Understanding Dependency Injection for angular

    Understanding Dependency Injection for angular

    Angular https://angular.io/guide/dependency-injection Denpendency Injection,? or DI, is one of fundamental concepts for angular, DI is writed by angular framework and allows classes with? Angular decorators,? such as Components, directives, Piples and Injectables , to configure dependencies that they need. ?Two main roles exists in DI system: dependency

    2024年02月10日
    瀏覽(43)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包