Description:
Field sessionTemplate in com.xxx.common.BaseDaoImpl required a bean of type 'org.mybatis.spring.SqlSessionTemplate' that could not be found.
- Bean method 'sqlSessionTemplate' not loaded because @ConditionalOnBean (types: javax.sql.DataSource; SearchStrategy: all) did not find any beans of type javax.sql.DataSource
Action:
Consider revisiting the entries above or defining a bean of type 'org.mybatis.spring.SqlSessionTemplate' in your configuration.
springBoot自动注入时出错,查了一下,是因为我在application中加了exclude = DataSourceAutoConfiguration.class导致的,删掉后就可以了,如果还不能启动,再加上@ComponentScan(basePackages = "com.xxx.*")就可以了