当前位置: 代码迷 >> 综合 >> 错误:Parameter 0 of method sqlSessionFactory in MyBatisConfig required a bean of type ‘javax.sql.DataS
  详细解决方案

错误:Parameter 0 of method sqlSessionFactory in MyBatisConfig required a bean of type ‘javax.sql.DataS

热度:78   发布时间:2024-02-23 04:24:00.0

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)
  相关解决方案