spring管理載入bean錯誤;Injection of autowired dependencies failed;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.e3mall.service.ItemService cn.e3mall.controller.ItemController.itemService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.e3mall.service.ItemService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 29 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.e3mall.service.ItemService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)
... 31 more
一月 27, 2018 11:59:41 上午 org.apache.catalina.core.StandardContext loadOnStartup
嚴重: Servlet threw load() exception
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.e3mall.service.ItemService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
注意紅色的字型,說明就是spring在管理建立bean的時候發生了錯誤,一是檢查註解是否正確@Service;二是看看web.xml中配置的 如圖:
相關推薦
spring管理載入bean錯誤;Injection of autowired dependencies failed;
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemController': Injection of autowired dependen
Injection of autowired dependencies failed; autowire 自動註入失敗,測試類已初始化過了Spring容器。
ins cor als proc methods ase servle res resolved 1 嚴重: StandardWrapper.Throwable 2 org.springframework.beans.factory.BeanCreationExc
品優購Error creating bean with name 'itemPageServiceImpl': Injection of autowired dependencies failed
異常資訊 嚴重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.spr
Error creating bean with name 'bookShopListImpl': Injection of autowired dependencies failed;
Could not autowire field Error creating bean with name 'bookShopListImpl': Injection of autowired dependencies failed; org.springframew
Spring Boot異常:BeanCreationException:Injection of autowired dependencies failed;
問題描述: 在使用spring boot框架實現事務控制demo時,啟動專案報錯如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'qu
Error creating bean with name '***(類名)': Injection of autowired dependencies failed;
整springMVC時報錯如下圖: 參考了好多方法,可能是由於和別人jar包和別的環境差別的原因,總是500錯誤 資訊裡有句“Error creating bean with name ‘productController’: Injection of
異常:Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException
leg not 出現 resolve auto -s 啟動 文件名 書寫 這個異常是出現在註入配置文件中配置好的屬性時報錯的: Injection of autowired dependencies failed; nested exception is java.lan
Injection of autowired dependencies failed; 的解決辦法!
1.檢查你專案中有沒有多餘的@Autowired 如果你引入了多餘(或者錯誤的)的@Autowired就會導致以上錯誤 一般這個錯誤都是發生在controll,dao,service中,看看你的註解是否有多餘或者錯誤 Dao—@Repo
Injection of autowired dependencies failed解決方式
異常如下: ERROR [RMI TCP Connection(3)-127.0.0.1] - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error cre
BeanCreationException:Injection of autowired dependencies failed解決思路(宜立方專案)
今天在用maven整合smm框架的時候遇到了bug: 按報錯的描述來說應該是註解建立失敗,其出錯點在controller那裡。但是回去看了一下controller層並沒有語法編寫錯誤, 那麼可能的原因就是在@service注入的時候出現了問題 service層:
解決Injection of autowired dependencies failed的報錯
錯誤: 嚴重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springfr
Redis 報錯 Injection of autowired dependencies failed;
Injection of autowired dependencies failed; nested exception is org.springframework.data.redis.Redis
Error creating bean with name 'fileController': Injection of resource dependencies failed;
alt context http original pen isp listener uestc file 1.錯誤描述 Exception sending context initialized event to listener instance of class o
Injection of resource dependencies failed;錯誤幾種解決方法
Error creating bean with name 'connDataController': Injection of resource dependencies failed; 最近研究ssm專案的時候出現這個問題,去網上一搜那答案真是差不多,都沒有解決我的問題,後來在重複搭建專案後
解決Error creating bean with name XXX: Injection of resource dependencies failed
解決SSH整合時出現的錯誤,錯誤如上圖所示。 該錯誤是因為Mybatis中需要的註解,spring沒有檢測到此註解資訊。 錯誤原因可能有四處: (1):web.xml沒有配置spring的上下文環境和核心的監聽器 解決辦法: 在web.xml新增 <!--s
Error creating bean with name 'investExcelController': Injection of resource dependencies failed;
啟動springboot的過程中,報以下錯誤: Error creating bean with name ‘investExcelController’:Injection of resource dependencies failed; Error creating bean with
Error creating bean with name 'userController': Injection of resource dependencies failed;
Springmvc問題 今天,做開發時,剛配置好環境,測試一下環境是否正常,然後日誌報錯是: org.springframework.beans.factory.BeanCreationExcep
spring注入失敗 Injection of resource dependencies failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'visitCopyRightSubjectService': Injection of resou
解決:Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.
今天除錯專案程式碼,出現的引resource的Injection報錯,查原因查了好長時間才找到,現在這裡總結一下,以免以後忘掉以及給大家參考。 最終原因是迴圈呼叫,也就是我要注入的那個類也呼叫了我當前在寫的類; 報錯大致內容入下: Error starting Ap
Spring MVC 配置報錯: Error creating bean with name 'userController': Injection of resource dependencies
今天做了一個簡單的專案,用spring+springMVC實現使用者的CRUD,看似簡單的一個小demo,卻在配置上浪費了不少時間,首先看一下目錄結構:專案要求使用jdbcTemplate配置資料來源,下面附上spring的配置檔案和springMVC的配置檔案,分別如下:a