异常信息
Caused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.dbl.user.mapper.SysUserMapper.selectOne
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:235) ~[mybatis-3.5.3.jar:3.5.3]
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:53) ~[mybatis-3.5.3.jar:3.5.3]
at org.apache.ibatis.binding.MapperProxy.lambda$cachedMapperMethod$0(MapperProxy.java:98) ~[mybatis-3.5.3.jar:3.5.3]
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_152]
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:97) ~[mybatis-3.5.3.jar:3.5.3]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:92) ~[mybatis-3.5.3.jar:3.5.3]
at com.sun.proxy.$Proxy61.selectOne(Unknown Source) ~[na:na]
at com.dbl.user.service.impl.SysUserServiceImpl.selectByAccount(SysUserServiceImpl.java:77) ~[classes/:na]
at com.dbl.user.service.impl.UserDetailsServiceImpl.loadUserByUsername(UserDetailsServiceImpl.java:35) ~[classes/:na]
at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:93) ~[spring-security-core-5.5.1.jar:5.5.1]
... 57 common frames omitted
问题原因
官方文档:出现-invalid-bound-statement-not-found-异常
解决方案
既然不能使用SqlSessionFactory,那就改成MybatisSqlSessionFactoryBean就OK了