在进行springBoot项目启动时,突然报:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
###Error querying database. Cause: java.lang.IllegalStateException: dbType not support : null, url mineUrl
###The error may exist in com///dao/mapper/SerialNumberMapper.java (best guess)
###The error may involve com...dao.mapper.SerialNumberMapper.findSerialNumberByPerfix
###The error occurred while executing a query
###Cause: java.lang.IllegalStateException: dbType not support : null, url mineUrl
解决方案:
首先sql本身一点问题没有,排除掉了是mapper层面语句错误的问题
其次,百度并查看项目中的.yml配置文件,发现在某个数据源下的数据库连接名称 前缀写的有问题。导致使用配置文件进行数据源注入时,无法正确的进行注入。 把名称修改正确就好了。根本原因还是自己配置的问题。