The following classes could not be excluded because they are not auto

在Springboot启动项目的时候,出现如下错误

1java.lang.IllegalStateException: The following classes could not be excluded because they are not auto-configuration classes: 2- org.springframework.boot.autoconfigure.jdbc.DataSourceProperties 3 4at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.handleInvalidExcludes(AutoConfigurationImportSelector.java:209) ~[spring-boot-autoconfigure-2.1.7.RELEASE.jar:2.1.7.RELEASE] 5at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.checkExcludedClasses(AutoConfigurationImportSelector.java:195) ~[spring-boot-autoconfigure-2.1.7.RELEASE.jar:2.1.7.RELEASE] 6at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.getAutoConfigurationEntry(AutoConfigurationImportSelector.java:119) ~[spring-boot-autoconfigure-2.1.7.RELEASE.jar:2.1.7.RELEASE] 7at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector$AutoConfigurationGroup.process(AutoConfigurationImportSelector.java:396) ~[spring-boot-autoconfigure-2.1.7.RELEASE.jar:2.1.7.RELEASE] 8at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGrouping.getImports(ConfigurationClassParser.java:875) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] 9at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:801) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] 10at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:771) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] 11at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:185) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] 12at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:315) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] 13at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] 14at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] 15at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE] 16 ...

这句话的意思是“不能排序以下类,因为它不是自动配置类”

以下类:指的就是错误第二行的DataSourceProperties,所以检查代码发现

1@SpringBootApplication(exclude = DataSourceProperties.class) 2public class ServerApplication { 3 4 public static void main(String[] args) { 5 SpringApplication.run(ServerApplication.class, args); 6 } 7 8}

这个里面exclude只能排除auto-configuration类型的类,而DataSourceProperties.class 并不是,所以不能排除在这

代码写错了,应该是要排除DataSourceAutoConfiguration.class,用来排除不进行数据库连接设置

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )

Spring Boot 406(type=Not Acceptable, status=406)异常解决办法

使用SpringBoot,Controller请求返回的参数类型是ResponseBody,如果请求的时候使用使用配置的默认请求扩展名,例如.html,SpringMVC会抛出一个typeNotAcceptable,status406错误,如下:WhitelabelErrorPageThisapplica

IE7、IE8、IE9对min

问题:    IE7、IE8、IE9对minheight不识别,其他无问题解决:   box{width:100px;height:35px;}   htmlbodybox{width:auto;height:auto;width:100px;minheight:35px;} 实例: