少一块的拼图 2022-02-03 18:12 采纳率: 50%
浏览 85
已结题

spring获取Druid连接池调用init方法失败

报错:2月 03, 2022 5:28:12 下午 org.springframework.context.support.AbstractApplicationContext refresh
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybits-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'org/example/dao/StudentDao.xml'. Cause: org.apache.ibatis.builder.BuilderException: Wrong namespace. Expected 'org.example.dao.StudentDao' but found 'org.example.dao.studentDao'.
代码:

img

  • 写回答

2条回答 默认 最新

  • 关注

    studentDao文件名称的student的首字母s改为大写字母S即可(StudentDao)。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 2月17日
  • 已采纳回答 2月9日
  • 创建了问题 2月3日