Spring中出現:No bean named 'XXX' available問題解決
今天開發的時候遇到了一個問題,報了一個異常:No bean name 'ProvincialServiceImpl' available。
異常顯示我的實現類注入bean失敗了,我把截圖放上來:
我先檢查了一遍,配置檔案中掃描肯定是沒有問題的,但是在我的單元測試中出現了問題,通過查閱資料,解決如下:
註解如果沒有指定bean的名字,預設為小寫開頭的類名。例如類名是ProvincialServiceImpl,則spring返回provincialServiceImpl的bean名。
相關文章
- No bean named ''XXX“ availableBeanAI
- spring中No bean named xxx available錯誤SpringBeanAI
- 程式碼改造引發的NoSuchBeanDefinitionException:no bean named 'XXXX' available問題解決方案BeanExceptionAI
- Spring:錯誤No bean named 'xxxxxxx' availableSpringBeanAI
- idea maven搭建spring報錯:No bean named 'xxx' availableIdeaMavenSpringBeanAI
- No Bean named 'Xxx' available 異常報錯BeanAI
- 使用@Service註解出現No bean named 'xxxx' available]錯誤BeanAI
- No bean named BookServiceImpl availableBeanAI
- spring-mybatis整合:NoSuchBeanDefinitionException: No bean named 'xxx.class' availableSpringMyBatisBeanExceptionAI
- Maven專案報錯:No bean named 'xxxxxx' availableMavenBeanAI
- SpringBoot 學習之 No bean named ‘xxx’ availableSpring BootBeanAI
- No bean named 'xxx' is defined錯誤,原因及解決方案Bean
- Spring Boot學習之No bean named 'entityManagerFactory' available異常Spring BootBeanAI
- Caused by:.NoSuchBeanDefinitionException: No bean named 'userInfoServiceImpl' availableBeanExceptionAI
- Spark SQL中出現 CROSS JOIN 問題解決SparkSQLROS
- No module named MYSQLdb 問題解決MySql
- No bean named 'cacheManager' availablej 異常解決BeanAI
- 解決eclipse中出現Resource is out of sync with the file system問題Eclipse
- spring getBean(String) No bean named '' is definedSpringBean
- ImportError: No module named thrift.Thrift問題解決ImportError
- 解決Spring中singleton中注入prototype Bean的問題SpringBean
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'aaaa' availableSpringFrameworkBeanExceptionAI
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxxxx' iSpringFrameworkBeanException
- struts+hibernate+spring 整合中出現的問題Spring
- opatch option Not available yet問題的解決方法AI
- R語言中package ‘xxxx’ is not available (for R version 3.2.5)解決R語言PackageAI
- 對於python中出現UnicodeDecodeError問題的解決方案PythonUnicodeError
- could not autowire. No beans of 'xxxx' 問題解決Bean
- 解決AIX 5.3 & Oracle 10g EM中出現的亂嗎問題AIOracle 10g
- 記一次idea構建springmvc報錯:No bean named 'cacheManager' availableIdeaSpringMVCBeanAI
- MySQL 中出現報錯提示: ‘Variable ‘XXX‘ is a read only variable‘的解決方法MySql
- 解決 Sorry,this Adobe app is not available 問題的方法APPAI
- 解決Python找不到ssl模組問題 No module named _sslPython
- Scrapy學習中解決No module named tutorial.items問題
- yum安裝軟體時,出現"No package XXX available"的解決辦法PackageAI
- git中出現”the requested upstream branch ‘origin/master‘ does not exist“問題的解決GitAST
- 解決svn遷移過程中出現:SVN Error: is not the same repository as的問題Error
- Git:warning: CALF wilL be replaced by LF in xxxx 問題解決Git