SpringBoot启动错误:
***************************
APPLICATION FAILED TO START
***************************Description:Parameter 0 of method sqlSessionFactory in com.yky.ykyAdmin.farmework.config.MyBatisConfig required a bean of type 'javax.sql.DataSource' that could not be found.The following candidates were found but could not be injected:- Bean method 'dataSource' in 'JndiDataSourceAutoConfiguration' not loaded because @ConditionalOnProperty (spring.datasource.jndi-name) did not find property 'jndi-name'- Bean method 'dataSource' in 'XADataSourceAutoConfiguration' not loaded because @ConditionalOnClass did not find required class 'javax.transaction.TransactionManager'Action:Consider revisiting the entries above or defining a bean of type 'javax.sql.DataSource' in your configuration.Process finished with exit code 1
解决:
去除启动类中的
(exclude = DataSourceAutoConfiguration.class)