caused by:org.springframework.beans.factory.NoSuchBeanDefinitionException

Source: Internet
Author: User

1. Description of the error

Usage:java Org.apache.catalina.startup.Catalina [-config {pathname}] [-nonaming] {-help | start | Stop}2014-7-13 1 8:02:58 org.apache.catalina.core.AprLifecycleListener init info: Loaded APR based Apache Tomcat Native Library 1.1.29 using A PR version 1.4.8.2014-7-13 18:02:59 org.apache.catalina.core.AprLifecycleListener init info: APR Capabilities:ipv6 [True] , Sendfile [true], accept filters [FALSE], random [true].2014-7-13 18:03:00 Org.apache.catalina.core.AprLifecycleListener Initializessl Info: OpenSSL successfully initialized (OpenSSL 1.0.1e 2014-7-13 18:03:00 org.apache.coyote.AbstractProtocol init information: Initializing protocolhandler ["http-apr-8686"] 2014-7-13 18:03:00 org.apache.coyote.AbstractProtocol init info: Initializing protocolhandler ["ajp-apr-8009"]2014-7-13 18:03:00 Org.apache.catalina.startup.Catalina Load Info: Initialization processed in 2580 ms2014-7-13 18:03:00 Org.apache.catalina.core.StandardService startinternal Info: Starting service catalina2014-7-13 18:03:00 orG.apache.catalina.core.standardengine startinternal Info: Starting Servlet engine:apache tomcat/7.0.532014-7-13 18:03:03 org.apache.tomcat.websocket.server.WsSci onstartup Info: JSR 356 websocket (Java WebSocket 1.0) support isn't avail Able when running on Java 6.  To suppress this message, run Tomcat in Java 7, remove the WebSocket JARs from $CATALINA _home/lib or add the Websocketjars To the Tomcat.util.scan.DefaultJarScanner.jarsToSkip property in $CATALINA _base/conf/catalina.properties. Note that the deprecated Tomcat 7 WebSocket API would be available. 2014-7-13 18:03:03 org.apache.catalina.util.SessionIdGenerator createsecurerandom Info: Creation of SecureRandom Instance for session ID generation using [sha1prng] took [144] milliseconds.2014-7-13 18:03:04 Org.apache.catalina.startu P.hostconfig deploydirectory Info: Deploying Web application Directory D:\MyEclipse\apache-tomcat-7.0.53\webapps\ DOCS2014-7-13 18:03:04 org.apache.catalina.startup.HostConfig deploydirectory info: Deploying Web Application directory D:\MyEclipse\apache-tomcat-7.0.53\webapps\examples2014-7-13 18:03:05 Org.apache.catalina.core.ApplicationContext Log Info: contextlistener:contextinitialized () 2014-7-13 18:03:05 Org.apache.catalina.core.ApplicationContext Log Info: sessionlistener:contextinitialized () 2014-7-13 18:03:05 Org.apache.catalina.core.ApplicationContext Log information: contextlistener:attributeadded (' Org.apache.jasper.compiler.TldLocationsCache ', ' [email protected] ') 2014-7-13 18:03:05 Org.apache.catalina.startup.HostConfig deploydirectory Info: Deploying Web application Directory D:\MyEclipse\ APACHE-TOMCAT-7.0.53\WEBAPPS\FIRSTSSH2014-7-13 18:03:12 org.apache.catalina.core.ApplicationContext Log info: No Spring Webapplicationinitializer types detected on classpath2014-7-13 18:03:12 Org.apache.catalina.core.ApplicationContext Log Info: Initializing Spring root webapplicationcontext2014-7-13 18:03:12 Org.springframework.web.context.ContextLoader initwebapplicationcontext Info: Root webapplicationcontext: InitializatiOn started2014-7-13 18:03:12 org.springframework.web.context.support.XmlWebApplicationContext Preparerefresh Info: refreshing Root webapplicationcontext:startup Date [Sun Jul 18:03:12 CST 2014]; Root of context hierarchy2014-7-13 18:03:12 Org.springframework.beans.factory.xml.XmlBeanDefinitionReader Loadbeandefinitions info: Loading XML bean Definitions from ServletContext resource [/web-inf/applicationcontext.xml] 2014-7-13 18:03:13 Org.springframework.context.annotation.ClassPathBeanDefinitionScanner registerdefaultfilters Info : JSR-250 ' Javax.annotation.ManagedBean ' found and supported for component SCANNING2014-7-13 18:03:13 Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer loadproperties Info: Loading Properties File From class path resource [jdbc.mysql.properties]2014-7-13 18:03:14 Org.springframework.web.context.ContextLoader Initwebapplicationcontext severity: Context initialization failedorg.springframework.beans.factory.BeanCreationException : Error creating Bean with NamE ' Studentserviceimpl ': Injection of autowired dependencies failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Could not Autowire field:private Com.you.user.dao.StudentDao Com.you.user.service.impl.StudentServiceImpl.studentDao; Nested exception is Org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type [  Com.you.user.dao.StudentDao] found for dependency:expected at least 1 beans 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.postProcessPropertyValues ( autowiredannotationbeanpostprocessor.java:292) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean ( abstractautowirecapablebeanfactory.java:1139) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (Abstractautowirecapablebeanfactory.java:537) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:475) at org.springframework.beans.factory.support.abstractbeanfactory$1. GetObject (abstractbeanfactory.java:299) at Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:228) at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:295) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:195) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:665) at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:760) at Org.springframework.context.support.AbstractApplicationContext.refresh ( abstractapplicationcontext.java:482) at Org.spriNgframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext (contextloader.java:389) at Org.springframework.web.context.ContextLoader.initWebApplicationContext (contextloader.java:294) at Org.springframework.web.context.ContextLoaderListener.contextInitialized (contextloaderlistener.java:106) at Org.apache.catalina.core.StandardContext.listenerStart (standardcontext.java:4973) at Org.apache.catalina.core.StandardContext.startInternal (standardcontext.java:5467) at Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:150) at Org.apache.catalina.core.ContainerBase.addChildInternal (containerbase.java:901) at Org.apache.catalina.core.ContainerBase.addChild (containerbase.java:877) at Org.apache.catalina.core.StandardHost.addChild (standardhost.java:632) at Org.apache.catalina.startup.HostConfig.deployDirectory (hostconfig.java:1229) at Org.apache.catalina.startup.hostconfig$deploydirectory.run (hostconfig.java:1875) at Java.util.concurrent.executors$runnableadapter.call (executors. java:441) at Java.util.concurrent.futuretask$sync.innerrun (futuretask.java:303) at Java.util.concurrent.FutureTask.run (futuretask.java:138) at java.util.concurrent.threadpoolexecutor$ Worker.runtask (threadpoolexecutor.java:886) at Java.util.concurrent.threadpoolexecutor$worker.run ( threadpoolexecutor.java:908) at Java.lang.Thread.run (thread.java:619) caused by: Org.springframework.beans.factory.BeanCreationException:Could not Autowire field:private Com.you.user.dao.StudentDao Com.you.user.service.impl.StudentServiceImpl.studentDao; Nested exception is Org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type [  Com.you.user.dao.StudentDao] found for dependency:expected at least 1 beans 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:505) at Org.springframework.beans.factory.annotation.InjectionMetadata.inject ( injectionmetadata.java:87) at Org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues ( autowiredannotationbeanpostprocessor.java:289) ... morecaused by:org.springframework.beans.factory.NoSuchBeanDefinitionException:No Qualifying Bean of type [  Com.you.user.dao.StudentDao] found for dependency:expected at least 1 beans 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:1051) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency ( defaultlistablebeanfactory.java:919) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(defaultlistablebeanfactory.java:820) at Org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject (autowiredannotationbeanpostprocessor.java:477) ... MORE2014-7-13 18:03:14 org.apache.catalina.core.StandardContext listenerstart severity: Exception Sending context Initialized event to listener instance of class Org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException: Error creating Bean with Name ' Studentserviceimpl ': Injection of autowired dependencies failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Could not Autowire field:private Com.you.user.dao.StudentDao Com.you.user.service.impl.StudentServiceImpl.studentDao; Nested exception is Org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type [  Com.you.user.dao.StudentDao] found for dependency:expected at least 1 beans 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.postProcessPropertyValues ( autowiredannotationbeanpostprocessor.java:292) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean ( abstractautowirecapablebeanfactory.java:1139) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:537) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:475) at org.springframework.beans.factory.support.abstractbeanfactory$1. GetObject (abstractbeanfactory.java:299) at Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:228) at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (Abstractbeanfactory.java:295) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:195) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:665) at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:760) at Org.springframework.context.support.AbstractApplicationContext.refresh ( abstractapplicationcontext.java:482) at Org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext (contextloader.java:389) At Org.springframework.web.context.ContextLoader.initWebApplicationContext (contextloader.java:294) at Org.springframework.web.context.ContextLoaderListener.contextInitialized (contextloaderlistener.java:106) at Org.apache.catalina.core.StandardContext.listenerStart (standardcontext.java:4973) at Org.apache.catalina.core.StandardContext.startInternal (standardcontext.java:5467) at Org.apache.catalina.util.Lifecyclebase.start (lifecyclebase.java:150) at Org.apache.catalina.core.ContainerBase.addChildInternal ( containerbase.java:901) at Org.apache.catalina.core.ContainerBase.addChild (containerbase.java:877) at Org.apache.catalina.core.StandardHost.addChild (standardhost.java:632) at Org.apache.catalina.startup.HostConfig.deployDirectory (hostconfig.java:1229) at Org.apache.catalina.startup.hostconfig$deploydirectory.run (hostconfig.java:1875) at Java.util.concurrent.executors$runnableadapter.call (executors.java:441) at java.util.concurrent.futuretask$ Sync.innerrun (futuretask.java:303) at Java.util.concurrent.FutureTask.run (futuretask.java:138) at Java.util.concurrent.threadpoolexecutor$worker.runtask (threadpoolexecutor.java:886) at Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:908) at Java.lang.Thread.run ( thread.java:619) caused by:org.springframework.beans.factory.BeanCreationException:Could not autowire field:private Com.you.user.dao.StudentDao COM.YOU.USER.SERVICE.IMPL.STudentserviceimpl.studentdao; Nested exception is Org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type [  Com.you.user.dao.StudentDao] found for dependency:expected at least 1 beans 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:505) at Org.springframework.beans.factory.annotation.InjectionMetadata.inject (injectionmetadata.java:87) at Org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues ( autowiredannotationbeanpostprocessor.java:289) ... morecaused by:org.springframework.beans.factory.NoSuchBeanDefinitionException:No Qualifying Bean of type [ Com.you.user.dao.StudentDao] found for dependency:expected at least 1 bean which qualifies asAutowire candidate for this dependency. Dependency annotations: {@org. springframework.beans.factory.annotation.Autowired (required=true)}at Org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException ( defaultlistablebeanfactory.java:1051) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency ( defaultlistablebeanfactory.java:919) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency ( defaultlistablebeanfactory.java:820) at Org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject (autowiredannotationbeanpostprocessor.java:477) ... MORE2014-7-13 18:03:14 Com.sun.faces.config.ConfigureListener contextinitialized Info: Initialize the/firstssh of the context ' Mojarra ' 2.0.3 (FCS b03) 2014-7-13 18:03:14 com.sun.faces.spi.InjectionProviderFactory CreateInstance information: JSF1048: Available Postconstruct/predestroy Gaze.

The Managedbeans method labeled with these stares will indicate that the gaze has been processed.

2014-7-13 18:03:15 org.apache.catalina.core.StandardContext startinternal severity: Error listenerstart2014-7-13 18:03:15 Org.apache.catalina.core.StandardContext startinternal Serious: Context [/firstssh] startup failed due to previous ERRORS2014-7-13 18:03:15 org.apache.catalina.core.ApplicationContext Log info: Closing Spring root WEBAPPLICATIONCONTEXT2014-7-13 18:03:15 Org.apache.catalina.loader.WebappClassLoader Checkthreadlocalmapforleaks Critical: The Web application [/FIRSTSSH] created a ThreadLocal with key of type [Com.sun.faces.util. UTIL$1] (value [[email protected]]) and a value of type [JAVA.UTIL.HASHMAP] (value [{com.sun.faces.patterncache={=} }] but failed to remove it when the Web application was stopped. Threads is going to being renewed over time to try and avoid a probable memory leak.2014-7-13 18:03:15 ORG.APACHE.CATALINA.S Tartup. Hostconfig deploydirectory Info: Deploying Web application Directory D:\MyEclipse\apache-tomcat-7.0.53\webapps\ HOST-MANAGER2014-7-13 18:03:15 Org.apache.cataliNa.startup.HostConfig deploydirectory Info: Deploying Web application Directory D:\MyEclipse\apache-tomcat-7.0.53\ WEBAPPS\MANAGER2014-7-13 18:03:15 org.apache.catalina.startup.HostConfig deploydirectory info: Deploying Web Application directory D:\MyEclipse\apache-tomcat-7.0.53\webapps\ROOT2014-7-13 18:03:15 Org.apache.coyote.AbstractProtocol Start Info: Starting Protocolhandler ["http-apr-8686"]2014-7-13 18:03:15 Org.apache.coyote.AbstractProtocol Start Info: Starting Protocolhandler ["ajp-apr-8009"]2014-7-13 18:03:15 Org.apache.catalina.startup.Catalina Start Information: Server Startup in 14979 MS


2. Cause of error

Added a section to the Applicationcontext.xml:

<bean id= "Studentserviceimpl" class= "Com.you.user.service.impl.StudentServiceImpl" scope= "Singleton" lazy-init= "False" >
<property name= "Studentdao" ref= "Studentdaoimpl"/>
</bean>


3, the solution of the method

Remove this paragraph


Caused by:org.springframework.beans.factory.NoSuchBeanDefinitionException

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.