王建新 2016-10-21 09:26 采纳率: 13.6%
浏览 1671
已结题

SSM框架搭建后,运行出错,上图

[ERROR] Failed startup of context org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@1b1ee57f{/,E:\ssm\src\main\webapp}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mainController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.wangjianxin.test.manager.StudentManager com.wangjianxin.test.controller.MainController.studentManager; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentManagerImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.wangjianxin.test.dao.StudentDao com.wangjianxin.test.manager.impl.StudentManagerImpl.studentDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.wangjianxin.test.dao.StudentDao] 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)}
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentDao' defined in file [E:\ssm\target\classes\com\wangjianxin\test\dao\StudentDao.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:com/wangjianxin/test/mapping/*.xml]: class path resource [com/wangjianxin/test/mapping/] cannot be resolved to URL because it does not exist
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentDao' defined in file [E:\ssm\target\classes\com\wangjianxin\test\dao\StudentDao.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:com/wangjianxin/test/mapping/*.xml]: class path resource [com/wangjianxin/test/mapping/] cannot be resolved to URL because it does not exist
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292)

图片说明

  • 写回答

2条回答 默认 最新

  • admin_cx 2016-10-21 09:31
    关注

    Could not autowire field: private com.wangjianxin.test.manager.StudentManager com.wangjianxin.test.controller.MainController.studentManager; 这句话是关键,看一下配置文件是否哪里有错

    评论

报告相同问题?

悬赏问题

  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决