eclips maven项目ssm框架整合后运行报错Error creating bean with name 'itemServiceImpl': Injection of autowir
来源:互联网 发布:淘宝基金如何赎回 编辑:程序博客网 时间:2024/06/06 19:05
错误如下:
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.taotao.mapper.TbItemMapper com.taotao.service.impl.ItemServiceImpl.itemMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.taotao.mapper.TbItemMapper] 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.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
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:744)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.taotao.mapper.TbItemMapper com.taotao.service.impl.ItemServiceImpl.itemMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.taotao.mapper.TbItemMapper] 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:558)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 22 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.taotao.mapper.TbItemMapper] 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:1308)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1054)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:530)
... 24 more
原因:使用逆向工程生成的mapper包名和配置文件中配置的包名不同
解决办法:从新逆向工程或者更改包名和pom.xml等配置文件中的包名
阅读全文
0 0
- eclips maven项目ssm框架整合后运行报错Error creating bean with name 'itemServiceImpl': Injection of autowir
- SSM 整合发生异常:Error creating bean with name 'itemsController': Injection of resource dependencies fail
- 整合ssm框架出现:Error creating bean with name 'loginController'
- Java-4-解决报错:Error creating bean with name 'globalAppObj': Injection of autowired dependencies failed
- spring boot 报错 Error creating bean with name 'indexController': Injection of autowired dependencies
- Spring MVC 配置报错: Error creating bean with name 'userController': Injection of resource dependencies
- spring整合mybatis 报creating bean with name 'checkReformOrderController': Injection of autowired
- Error creating bean with name '****': Injection of autowired dependencies failed
- Error creating bean with name 'menuController': Injection of autowired dependenc
- Error creating bean with name 'signService': Injection
- springMVC项目启动时出现bean注入失败的情况:Error creating bean with name 'XXX': Injection of autowired dependencies
- 使用ssm(spring+springmvc+mybatis)框架+maven构建项目不到数据库bean的id的问题:Error creating bean with name 'sqlSe
- bean依赖注入错误:Error creating bean with name 'itemService': Injection of autowired dependencies failed
- Spring 整合Hibernate报错:Error creating bean with name 'dataSource' defined in class path resource
- 关于Error creating bean with name 'loginDao': Injection of resource methods failed; 问题
- Error creating bean with name 'menuController': Injection of autowired dependency……
- Error creating bean with name 'com.you.user.dao.StudentDaoTest': Injection of autowired dependencies
- Error creating bean with name 'adminUserController': Injection of autowired dependencies failed;
- 对称加密------AES
- 数组中出现次数超过一半的数字
- postgresql模块——pg_stat_statements详解和安装测试(转载)
- Servlet、JSP及Web容器之间关系的理解
- jquery对象和DOM对象的相互转换
- eclips maven项目ssm框架整合后运行报错Error creating bean with name 'itemServiceImpl': Injection of autowir
- 字符设备驱动
- java dome 导入项目启动不了
- 获取当前时间
- flex4.5 eclipse3.6
- 选择器
- 在swift 4.0中用系统方法setValuesForKeys()赋值问题
- 文字检测与文字识别开源程序
- 两条线段相交判断学习理解