org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:C:\jiaoxue\apache-maven-3.6.1-bin\mvn_repo\org\springframework\boot\spring-boot-autoconfigure\2.3.9.RELEASE\spring-boot-autoconfigure-2.3.9.RELEASE.jar!/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration.class]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration due to org/springframework/dao/DataAccessException not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
时间: 2023-12-06 21:43:55 浏览: 320
spring配置文件说明.doc
这个异常是由于在读取候选组件类时出现了问题。具体来说,这个异常是由于在处理org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration类时,无法解析org/springframework/dao/DataAccessException类而引起的。可能的原因是您的配置依赖于该类,但是该类不可用。此外,如果您错误地将@ComponentScan注释放在默认包中,也可能会出现此问题。您可以检查一下您的依赖是否正确,并且没有将@ComponentScan注释放在默认包中。
阅读全文