No converter found capable of converting from type [java.lang.String] to type [java.util.Lis

今天启动项目的时候突然出现了这样一个异常:

No converter found capable of converting from type [java.lang.String] to type [java.util.Lis

意思应该就是我在某个地方将String转化为Class失败了,但是String转化为Class,应该是这个方法:

No converter found capable of converting from type [java.lang.String] to type [java.util.Lis

测试一下这个方法中的className如果不存在会报什么错:

No converter found capable of converting from type [java.lang.String] to type [java.util.Lis

No converter found capable of converting from type [java.lang.String] to type [java.util.Lis

猜测有点问题,但是还有哪个地方会用到将String转化为Class呢,突然想到会不会是配置文件,异常再往上看看,看到了Mybatis通用mapper有异常信息:

No converter found capable of converting from type [java.lang.String] to type [java.util.Lis

在yml文件中看看:

No converter found capable of converting from type [java.lang.String] to type [java.util.Lis

的确是这个地方类名写的有点问题,修改后问题解决。