学习spring框架时遇到一个问题。
记录一个错误:

 摘出最主要的提示:

Error creating bean with name 'sqlSessionFactory' defined in class path resource [application-config.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/yiwensi/wuye/mapper/paymentMapper (wrong name: com/yiwensi/wuye/mapper/PaymentMapper)

主要问题Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed;在创建bean时,调用初始化方法失败。从而引出后面集中嵌套的错误。
定位到最终代码Cannot find class: org.example.domain.Student不能够找到这个文件。下面是文件路径
 

报错原因:mapper接口名字和mapper,xml 名字没对上导致的错误 

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐