我一直在找这一句的错误*Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]:
结果老长的错误后面,最后的Invalid encoding name "UTF8".**是问题所在
将XXXMapper.xml文件中这里的utf8改成utf-8,找了两个小时,
在网上找原因,是这几种:
1.在mybatis配置文件和spring配置文件中都注册了同一个mapper,此时会出现报错,只要删掉mybatis中的配置mapper的部分就可以正常运行了。
2.spring配置标签中,把ref赋值错误的写成了value赋值,也会出现相同的错误,把value改回ref即可解决问题。
3.spring和mybatis结合的时候在spring配置bean的配置文件中没有把配置sqlSessionFa