Error creating bean with name 'sqlSessionFactory' defined in class path resource 报错解决
Posted 菜小鱼~
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Error creating bean with name 'sqlSessionFactory' defined in class path resource 报错解决相关的知识,希望对你有一定的参考价值。
报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name \'sqlSessionFactory\' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method \'sqlSessionFactory\' threw exception; nested exception is java.io.FileNotFoundException: class path resource [mybatis/SqlMapConfig.xml] cannot be opened because it does not exist
解决:
在 Application 上加注解:
1 @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
参考文档:
https://www.cnblogs.com/shifu8005/p/9873271.html
以上是关于Error creating bean with name 'sqlSessionFactory' defined in class path resource 报错解决的主要内容,如果未能解决你的问题,请参考以下文章
Error creating bean with name ‘requestMappingHandlerMapping‘
react(85)--error:Error creating bean with name ‘onlineStudyController‘:
Error creating bean with name 'eurekaAutoServiceRegistration'