Error creating bean with name 'employeeController': Unsatisfied dependency expressed through field 'employeeMapper'
Error creating bean with name 'employeeMapper' defined in file [D:\IdeaProjects\study\springBoot\target\classes\com\example\springboot\dao\EmployeeMapper.class]
Failed to parse mapping resource: 'file [D:\IdeaProjects\study\springBoot\target\classes\mybatis\mapper\EmployeeMapper.xml]'
最终问题出现在EmployeeMapper.xml文件里 是sql语句出了问题 但不确定是哪里的问题,把所有的sql语句全部注销,能够正常运行。
SpringBoot应用中MyBatis映射文件SQL错误解析
博客内容涉及SpringBoot整合MyBatis时遇到的问题,具体表现为在创建bean时由于EmployeeMapper.xml中的SQL语句错误导致依赖注入失败。尝试注释掉所有SQL语句后应用能正常运行,说明问题出在具体的查询或更新语句上。解决办法包括逐个排查SQL语句,检查语法和逻辑是否正确。

被折叠的 条评论
为什么被折叠?



