Error creating bean with name ‘dataSource‘:Unsatisfied dependency expressed through field ‘basicPro

Error creating bean with name 'dataSource': Unsatisfied dependency expressed through field 'basicProperties';

方案一:

SpringBoot项目启动时没有添加jdbc时需要在启动类上exclude掉MySQL!


@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class,
        DataSourceTransactionManagerAutoConfiguration.class,
        JdbcTemplateAutoConfiguration.class})

方案二:

或者pom.xml文件中增加jdbc依赖!


版权声明:本文为Be_insighted原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。