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

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

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632