AI智能
改变未来

No qualifying bean of type ****** available: expected at least 1 bean which

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name \'selectAllItems\': Unsatisfied dependency expressed through field \'itemsService\'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name \'itemsService\': Unsatisfied dependency expressed through field \'iteamsMapper\'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type \'com.test.Mapper.IteamsMapper\' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1272)org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:171)javax.servlet.GenericServlet.init(GenericServlet.java:158)org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1627)org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)java.lang.Thread.run(Thread.java:748)

我的解决方法:
加入

<!--配置监听器  读Spring的配置文件--><!--配置Spring··xml文件的路径--><context-param><param-name>contextConfigLocation</param-name><param-value>classpath:spring.xml</param-value>		<!--你的ApplicationContext路径--></context-param><!--配置Context加载的容器--><!--加载spring的容器--><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener>
赞(0) 打赏
未经允许不得转载:爱站程序员基地 » No qualifying bean of type ****** available: expected at least 1 bean which