ladenger 2016-12-30 08:04 采纳率: 0%
浏览 1728

一个mybatis测试启动遇到的问题

![图片说明
![图片说明
图片说明

图片说明
因为刚接触java不久 希望可以帮我解答下

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentDao' defined in URL [file:/C:/Users/%e6%8b%89%e7%81%af/workspace/student-A/target/classes/spring-sample-dao.xml]: 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 file [C:\Users\拉灯\workspace\student-A\target\classes\applicationContext-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:\Users\拉灯\workspace\student-A\target\classes\StudentMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'Student'. Cause: java.lang.ClassNotFoundException: Cannot find class: Student
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.ld.student-A.service.impl.StudentServiceImpl] for bean with name 'studentService' defined in URL [file:/C:/Users/%e6%8b%89%e7%81%af/workspace/student-A/target/classes/spring-sample-service.xml]; nested exception is java.lang.ClassNotFoundException: com.ld.student-A.service.impl.StudentServiceImpl

  • 写回答

10条回答

  • sinat_36587202 2016-12-30 08:10
    关注

    首先你看一看你的cfg.xml和映射文件有没有错,以及公共的sessionFactory

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题