spring boot 启动报错:
2019-08-01 18:46:05.929 INFO 1480 --- [ main] com.boss.fap.FapServiceMain2 : Starting FapServiceMain2 on LAPTOP-5F6BVL9M with PID 1480 (D:\eclipse-workspace1\git_src_sbp\frmis\src\trunk\fap-service\target\classes started by shigl in D:\eclipse-workspace1\git_src_sbp\frmis\src\trunk\fap-service)
2019-08-01 18:46:05.929 INFO 1480 --- [ main] com.boss.fap.FapServiceMain2 : No active profile set, falling back to default profiles: default
2019-08-01 18:46:05.983 INFO 1480 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@445b295b: startup date [Thu Aug 01 18:46:05 CST 2019]; root of context hierarchy
2019-08-01 18:46:06.423 INFO 1480 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from URL [jar:file:/C:/Users/shigl/.m2/repository/com/huawei/paas/cse/foundation-auth/2.3.39.8/foundation-auth-2.3.39.8.jar!/META-INF/spring/auth.bean.xml]
2019-08-01 18:46:06.541 INFO 1480 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from URL [jar:file:/C:/Users/shigl/.m2/repository/org/apache/servicecomb/foundation-common/1.1.0.B011.10/foundation-common-1.1.0.B011.10.jar!/META-INF/spring/common.bean.xml]
2019-08-01 18:46:06.559 INFO 1480 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from URL [jar:file:/C:/Users/shigl/.m2/repository/org/apache/servicecomb/foundation-config/1.1.0.B011.10/foundation-config-1.1.0.B011.10.jar!/META-INF/spring/cse.bean.xml]
2019-08-01 18:46:06.573 INFO 1480 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from URL [jar:file:/C:/Users/shigl/.m2/repository/org/apache/servicecomb/foundation-vertx/1.1.0.B011.10/foundation-vertx-1.1.0.B011.10.jar!/META-INF/spring/cse.bean.xml]
2019-08-01 18:46:06.586 INFO 1480 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from URL [jar:file:/C:/Users/shigl/.m2/repository/org/apache/servicecomb/handler-bizkeeper/1.1.0.B011.10/handler-bizkeeper-1.1.0.B011.10.jar!/META-INF/spring/cse.bean.xml]
2019-08-01 18:46:06.596 INFO 1480 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from URL [jar:file:/C:/Users/shigl/.m2/repository/org/apache/servicecomb/handler-loadbalance/1.1.0.B011.10/handler-loadbalance-1.1.0.B011.10.jar!/META-INF/spring/cse.bean.xml]
2019-08-01 18:46:06.606 INFO 1480 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from URL [jar:file:/C:/Users/shigl/.m2/repository/com/huawei/paas/cse/cse-handler-tcc/2.3.39.8/cse-handler-tcc-2.3.39.8.jar!/META-INF/spring/cse.tcc.bean.xml]
2019-08-01 18:46:06.635 INFO 1480 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from URL [jar:file:/C:/Users/shigl/.m2/repository/com/huawei/paas/cse/cse-handler-cloud-extension/2.3.39.8/cse-handler-cloud-extension-2.3.39.8.jar!/META-INF/spring/services.bean.xml]
2019-08-01 18:46:06.644 INFO 1480 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from URL [jar:file:/C:/Users/shigl/.m2/repository/org/apache/servicecomb/java-chassis-core/1.1.0.B011.10/java-chassis-core-1.1.0.B011.10.jar!/META-INF/spring/cse.bean.xml]
2019-08-01 18:46:07.130 INFO 1480 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2019-08-01 18:46:07.523 INFO 1480 --- [ main] o.a.s.c.ConfigurationSpringInitializer : Environment received, will get configurations from [org.springframework.core.env.StandardEnvironment@1462928549].
2019-08-01 18:46:07.544 WARN 1480 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2019-08-01 18:46:07.544 INFO 1480 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2019-08-01 18:46:07.559 INFO 1480 --- [ main] o.apache.servicecomb.config.ConfigUtil : create local config:
2019-08-01 18:46:07.559 INFO 1480 --- [ main] o.apache.servicecomb.config.ConfigUtil : jar:file:/C:/Users/shigl/.m2/repository/org/apache/servicecomb/java-chassis-core/1.1.0.B011.10/java-chassis-core-1.1.0.B011.10.jar!/microservice.yaml.
2019-08-01 18:46:07.559 INFO 1480 --- [ main] o.apache.servicecomb.config.ConfigUtil : jar:file:/C:/Users/shigl/.m2/repository/com/huawei/paas/cse/cse-solution-service-engine/2.3.39.8/cse-solution-service-engine-2.3.39.8.jar!/microservice.yaml.
2019-08-01 18:46:07.593 INFO 1480 --- [ main] o.a.s.f.common.utils.SPIServiceUtils : Found SPI service org.apache.servicecomb.config.spi.ConfigCenterConfigurationSource, count=1.
2019-08-01 18:46:07.593 INFO 1480 --- [ main] o.a.s.f.common.utils.SPIServiceUtils : 0. org.apache.servicecomb.config.archaius.sources.ConfigCenterConfigurationSourceImpl.
2019-08-01 18:46:07.593 WARN 1480 --- [ main] .a.s.ConfigCenterConfigurationSourceImpl : Config Center configuration source is not configured!
2019-08-01 18:46:07.593 INFO 1480 --- [ main] o.apache.servicecomb.config.ConfigUtil : Config Source serverUri is not correctly configured.
2019-08-01 18:46:07.791 INFO 1480 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-08-01 18:46:07.917 INFO 1480 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$31a1a8b4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-08-01 18:46:08.180 WARN 1480 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'usercodeTransDaoImpl': Unsatisfied dependency expressed through field 'jdbcTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.jdbc.core.JdbcTemplate' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2019-08-01 18:46:08.187 INFO 1480 --- [ main] utoConfigurationReportLoggingInitializer :
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-08-01 18:46:08.277 ERROR 1480 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field jdbcTemplate in com.boss.framework.dao.BaseDaoImpl required a bean of type 'org.springframework.jdbc.core.JdbcTemplate' that could not be found.
- Bean method 'jdbcTemplate' not loaded because @ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) did not find any beans
Action:
Consider revisiting the conditions above or defining a bean of type 'org.springframework.jdbc.core.JdbcTemplate' in your configuration.
有一种情况是springboot启动类包路径太深,导致注入的bean和配置文件扫描不到