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
- idea maven搭建spring報錯:No bean named 'xxx' availableIdeaMavenSpringBeanAI
- spring-mybatis整合:NoSuchBeanDefinitionException: No bean named 'xxx.class' availableSpringMyBatisBeanExceptionAI
- No Bean named 'Xxx' available 異常報錯BeanAI
- SpringBoot 學習之 No bean named ‘xxx’ availableSpring BootBeanAI
- Spring:錯誤No bean named 'xxxxxxx' availableSpringBeanAI
- 程式碼改造引發的NoSuchBeanDefinitionException:no bean named 'XXXX' available問題解決方案BeanExceptionAI
- No bean named BookServiceImpl availableBeanAI
- No bean named 'xxx' is defined錯誤,原因及解決方案Bean
- Caused by:.NoSuchBeanDefinitionException: No bean named 'userInfoServiceImpl' availableBeanExceptionAI
- 使用@Service註解出現No bean named 'xxxx' available]錯誤BeanAI
- Maven專案報錯:No bean named 'xxxxxx' availableMavenBeanAI
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'aaaa' availableSpringFrameworkBeanExceptionAI
- Spark SQL中出現 CROSS JOIN 問題解決SparkSQLROS
- No module named MYSQLdb 問題解決MySql
- No bean named 'cacheManager' availablej 異常解決BeanAI
- spring getBean(String) No bean named '' is definedSpringBean
- 解決 Sorry,this Adobe app is not available 問題的方法APPAI
- No instances available for XXXAI
- 報錯:org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxx'is definedSpringFrameworkBeanException
- MySQL 中出現報錯提示: ‘Variable ‘XXX‘ is a read only variable‘的解決方法MySql
- yum安裝軟體時,出現"No package XXX available"的解決辦法PackageAI
- 記一次idea構建springmvc報錯:No bean named 'cacheManager' availableIdeaSpringMVCBeanAI
- git中出現”the requested upstream branch ‘origin/master‘ does not exist“問題的解決GitAST
- 問題解決local variable 'xxx' referenced before assignment
- springboot註解實現非同步呼叫時no bean of type TaskExecutor and no bean named 'taskExecutor' eitherSpring Boot非同步Bean
- 解決Parameter '__frch_item_0' not found. Available parameters 問題AI
- 解決:ModuleNotFoundError: No module named ‘urllib3.packages.six.moves問題ErrorPackage
- 解決Python找不到ssl模組問題 No module named _sslPython
- pycharm環境,命令列執行提示:ImportError: No module named xxx 解決方法PyCharm命令列ImportError
- 如何解決精益生產專案中出現的問題?
- Authentication failure 以及xxx is not in the sudoers file 問題的解決辦法AI
- nuxtjs 安裝過程中出現問題UXJS
- No Task Available解決方法AI
- pip install了之後還是顯示no module named xxx的解決辦法
- Laravel 6 ignition 解決 Class 'xxx' not found 載入緩慢問題Laravel
- 【問題解決】java.sql.SQLException: null, message from server: “Host ‘xxx.xx.xx.xxx‘ is blocked because ofJavaSQLExceptionNullServerBloC