No bean named BookServiceImpl available
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘BookServiceImpl’ available
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'BookServiceImpl' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:771)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1221)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
at MyTest.test(MyTest.java:11)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
Process finished with exit code -1
原因是:沒有在applicationContext.xml檔案中,註冊其他xml資源,註冊後即可解決問題
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<import resource="spring-mvc.xml"/>
<import resource="spring-service.xml"/>
<import resource="spring-dao.xml"/>
</beans>
相關文章
- No bean named ''XXX“ availableBeanAI
- Caused by:.NoSuchBeanDefinitionException: No bean named 'userInfoServiceImpl' availableBeanExceptionAI
- No Bean named 'Xxx' available 異常報錯BeanAI
- spring中No bean named xxx available錯誤SpringBeanAI
- SpringBoot 學習之 No bean named ‘xxx’ availableSpring BootBeanAI
- Spring Boot學習之No bean named 'entityManagerFactory' available異常Spring BootBeanAI
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'aaaa' availableSpringFrameworkBeanExceptionAI
- Spring中出現:No bean named 'XXX' available問題解決SpringBeanAI
- idea maven搭建spring報錯:No bean named 'xxx' availableIdeaMavenSpringBeanAI
- 使用@Service註解出現No bean named 'xxxx' available]錯誤BeanAI
- spring-mybatis整合:NoSuchBeanDefinitionException: No bean named 'xxx.class' availableSpringMyBatisBeanExceptionAI
- 記一次idea構建springmvc報錯:No bean named 'cacheManager' availableIdeaSpringMVCBeanAI
- Maven專案報錯:No bean named 'xxxxxx' availableMavenBeanAI
- Spring:錯誤No bean named 'xxxxxxx' availableSpringBeanAI
- spring getBean(String) No bean named '' is definedSpringBean
- 程式碼改造引發的NoSuchBeanDefinitionException:no bean named 'XXXX' available問題解決方案BeanExceptionAI
- No bean named 'cacheManager' availablej 異常解決BeanAI
- 報錯No bean named ' is defined的原因和解決方案Bean
- springboot註解實現非同步呼叫時no bean of type TaskExecutor and no bean named 'taskExecutor' eitherSpring Boot非同步Bean
- spring與mybatis中注入了卻總提示no bean namedSpringMyBatisBean
- No qualifying bean of type 'javax.sql.DataSource' available: expected at least 1BeanJavaSQLAIAST
- No bean named 'xxx' is defined錯誤,原因及解決方案Bean
- SpringMVC莫名其妙出現No bean named 'cacheManager' is defined錯誤SpringMVCBean
- spring配置檔案中配置了,但找不到Bean , 啟動不報錯,執行報錯No bean namedSpringBean
- 使用Idea構建springmvc框架,出現no bean named 'cacheManager' is defined 錯誤IdeaSpringMVC框架Bean
- 使用Idea構建springmvc框架,出現no bean named ‘cacheManager’ is defined 錯誤。IdeaSpringMVC框架Bean
- 報錯:org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxx'is definedSpringFrameworkBeanException
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxxxx' iSpringFrameworkBeanException
- laravel named routeLaravel
- InputStream之available()AI
- No free sectors availableAI
- Servlet action is not availableServletAI
- ImportError: No module named `defusedxml`ImportErrorXML
- ImportError: No module named yamlImportErrorYAML
- ImportError: No module named utilsImportError
- ModuleNotFoundError: No module named 'sqlite'ErrorSQLite
- ImportError: No module named cElementTreeImportError
- 模型Bean:Model Bean模型Bean