Error creating bean with name 'tomcatEmbeddedServletContainerFactory ' (or a BeanPostPro...

 

org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat
org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcatjava


tomcatEmbeddedServletContainerFactoryweb

問題:redis

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: factory-bean 'org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat' (or a BeanPostProcessor involved) returned nullspring

解決辦法:
json

解決過程:
剛開始看到這個報錯,以爲莫名其妙,什麼也沒作,怎麼就不行了。
看到是tomcatEmbeddedServletContainerFactory,就想會不是由於tomcat相關的配置錯誤,但看了下properties文件,除了這些,就沒有web服務的配置了
windows

 


就打了個斷點,跟了下,也沒有發現啥【陌生信息太多,迷失了。。。】


無心中使用關鍵詞搜了下,發如今日誌中出現的次數挺多。
api

 根據報錯信息的中「(or a BeanPostProcessor involved) returned null」  搜了下,看到這段:
tomcat

想起以前爲了梳理Spring啓動過程,對各類場景的加載順序時,也實現了一個BeanPostProcessor的實例。一個代碼,果真 返回了null
websocket

 




 



詳細日誌:mvc

2019-07-26 15:27:40.376  INFO 30704 --- [main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@78aab498: startup date [Fri Jul 26 15:27:40 CST 2019]; root of context hierarchy 2019-07-26 15:27:42.871  INFO 30704 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2019-07-26 15:27:43.174  INFO 30704 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'taskExecutorConfig' of type [com.tangcheng.learning.thread.TaskExecutorConfig$$EnhancerBySpringCGLIB$$f66efd1e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-07-26 15:27:43.178  INFO 30704 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 2019-07-26 15:27:43.892  INFO 30704 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'springInitBeanLifeCycleConfig' of type [com.tangcheng.learning.init.spring.SpringInitBeanLifeCycleConfig$$EnhancerBySpringCGLIB$$86d260bc] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-07-26 15:27:43.916  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean : begin to execute Constructor Function 2019-07-26 15:27:43.939  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean  : Step-3調用。BeanNameAware.setBeanName springInitBean 2019-07-26 15:27:43.947  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean  : Step-4調用。BeanFactoryAware.setBeanFactory org.springframework.beans.factory.support.DefaultListableBeanFactory@273444fe: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,demoApplication,org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory,restClient,conditionConfig,authorSettings,settingsConfig,eventBusConfig,observer1,observer2,subject,initBeanConfig,springInitBeanLifeCycleConfig,handler1Impl,handler2Impl,handlerService,redisDemo,echoBiz,quartzConfig,myJobFactory,echoJob,echoService,schedulerConfig,AServiceWithAopImpl,BServiceWithAopImpl,distributedLockAspect,distributeLockServiceImpl,defaultKeyGenerator,validatedServiceImpl,asyncTaskService,taskExecutorConfig,downController,helloController,httpMessageConverterTestController,invalidAopDemoController,MVC_DSL_TestController,mvcAnnotationDemoController,orderRestAPIController,requestParameterInitTestController,requestValidatedDemoController,serviceValidatedController,ctxCommandLine,globalExceptionHandler,randomStringConfig,redisConfig,restTemplateConfig,webConfig,indexController,weatherUserInfoExcelView,swaggerAutoConfiguration,swagger2Configuration,JSONPResponseBodyAdvice,fastJsonViewResponseBodyAdvice,fastJsonpResponseBodyAdvice,serviceModelToSwagger2MapperImpl,vendorExtensionsMapperImpl,parameterMapperImpl,modelMapperImpl,licenseMapperImpl,securityMapperImpl,apiListingReferenceScanner,apiDocumentationScanner,apiDescriptionReader,apiListingReader,cachingOperationReader,mediaTypeReader,apiListingScanner,apiModelReader,apiDescriptionLookup,operationModelsProvider,operationDeprecatedReader,responseMessagesReader,operationParameterReader,defaultTagsProvider,operationTagsReader,apiOperationReader,defaultOperationReader,operationParameterRequestConditionReader,operationParameterHeadersConditionReader,operationResponseClassReader,cachingOperationNameGenerator,parameterMultiplesReader,modelAttributeParameterExpander,parameterTypeReader,parameterRequiredReader,parameterDataTypeReader,parameterDefaultReader,parameterNameReader,expandedParameterBuilder,documentationPluginsBootstrapper,webMvcRequestHandlerProvider,documentationPluginsManager,queryStringUriTemplateDecorator,pathMappingDecorator,pathSanitizer,operationPathDecorator,cachingModelDependencyProvider,typeNameExtractor,propertyDiscriminatorBasedInheritancePlugin,xmlModelPlugin,schemaPluginsManager,cachingModelPropertiesProvider,objectMapperBeanPropertyNamingStrategy,accessorsProvider,fieldProvider,xmlPropertyPlugin,optimized,factoryMethodProvider,cachingModelProvider,defaultModelDependencyProvider,jacksonEnumTypeDeterminer,defaultModelProvider,apiModelPropertyPropertyBuilder,apiModelTypeNameProvider,apiModelBuilder,operationImplicitParameterReader,vendorExtensionsReader,swaggerOperationResponseClassReader,swaggerOperationModelsProvider,swaggerMediaTypeReader,operationHttpMethodReader,operationImplicitParametersReader,operationAuthReader,operationHiddenReader,operationSummaryReader,swaggerResponseMessageReader,operationNicknameIntoUniqueIdReader,operationPositionReader,operationNotesReader,swaggerOperationTagsReader,swaggerParameterDescriptionReader,swaggerExpandedParameterBuilder,swaggerApiListingReader,classOrApiAnnotationResourceGrouping,inMemorySwaggerResourcesProvider,apiResourceController,windowsListService,springfox.documentation.schema.configuration.ModelsConfiguration,typeResolver,modelBuilderPluginRegistry,modelPropertyBuilderPluginRegistry,typeNameProviderPluginRegistry,syntheticModelProviderPluginRegistry,springfox.documentation.spring.web.SpringfoxWebMvcConfiguration,defaults,resourceGroupCache,objectMapperConfigurer,jsonSerializer,descriptionResolver,methodResolver,documentationPluginRegistry,apiListingBuilderPluginRegistry,operationBuilderPluginRegistry,parameterBuilderPluginRegistry,expandedParameterBuilderPluginRegistry,resourceGroupingStrategyRegistry,operationModelsProviderPluginRegistry,defaultsProviderPluginRegistry,pathDecoratorRegistry,apiListingScannerPluginRegistry,springfox.documentation.swagger.configuration.SwaggerCommonConfiguration,springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration,swagger2Module,swagger2ControllerMapping,springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration,expanderMinMax,expanderNotNull,expanderPattern,expanderSize,parameterMinMax,parameterNotNull,parameterPattern,parameterSize,minMaxPlugin,decimalMinMaxPlugin,sizePlugin,notNullPlugin,patternPlugin,org.springframework.boot.autoconfigure.condition.BeanTypeRegistry,swaggerProperties,uiConfiguration,createRestApi,eventBus,initBean,springInitBean,scheduler,org.springframework.scheduling.annotation.SchedulingConfiguration,org.springframework.context.annotation.internalScheduledAnnotationProcessor,org.springframework.scheduling.annotation.ProxyAsyncConfiguration,org.springframework.context.annotation.internalAsyncAnnotationProcessor,commandLineRunner,randomStringGenerator,redisTemplate,stringRedisTemplate,hashOperations,listOperations,setOperations,zSetOperations,restTemplate,fastJsonHttpMessageConverter,org.springframework.boot.autoconfigure.AutoConfigurationPackages,org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration,propertySourcesPlaceholderConfigurer,org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration,standardJacksonObjectMapperBuilderCustomizer,spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties,org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor,org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.store,org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration,jacksonObjectMapperBuilder,org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration,jacksonObjectMapper,org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration,jsonComponentModule,org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration$TomcatWebSocketConfiguration,websocketContainerCustomizer,org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration,org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat,tomcatEmbeddedServletContainerFactory,org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration,embeddedServletContainerCustomizerBeanPostProcessor,errorPageRegistrarBeanPostProcessor,org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletConfiguration,dispatcherServlet,spring.mvc-org.springframework.boot.autoconfigure.web.WebMvcProperties,org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration,dispatcherServletRegistration,org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration,org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration,defaultValidator,methodValidationPostProcessor,org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration,error,beanNameViewResolver,org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$DefaultErrorViewResolverConfiguration,conventionErrorViewResolver,org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration,errorAttributes,basicErrorController,errorPageCustomizer,preserveErrorControllerTargetClassPostProcessor,spring.resources-org.springframework.boot.autoconfigure.web.ResourceProperties,org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration,requestMappingHandlerAdapter,requestMappingHandlerMapping,mvcValidator,mvcContentNegotiationManager,mvcPathMatcher,mvcUrlPathHelper,viewControllerHandlerMapping,beanNameHandlerMapping,resourceHandlerMapping,mvcResourceUrlProvider,defaultServletHandlerMapping,mvcConversionService,mvcUriComponentsContributor,httpRequestHandlerAdapter,simpleControllerHandlerAdapter,handlerExceptionResolver,mvcViewResolver,mvcHandlerMappingIntrospector,org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter$FaviconConfiguration,faviconHandlerMapping,faviconRequestHandler,org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter,defaultViewResolver,viewResolver,welcomePageHandlerMapping,requestContextFilter,org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration,hiddenHttpMethodFilter,httpPutFormContentFilter,org.springframework.boot.actuate.autoconfigure.AuditAutoConfiguration$AuditEventRepositoryConfiguration,auditEventRepository,org.springframework.boot.actuate.autoconfigure.AuditAutoConfiguration,auditListener,org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration$RedisConfiguration,org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration$RedisConnectionConfiguration,redisConnectionFactory,org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration,spring.redis-org.springframework.boot.autoconfigure.data.redis.RedisProperties,org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration,spring.info-org.springframework.boot.autoconfigure.info.ProjectInfoProperties,org.springframework.boot.actuate.autoconfigure.InfoContributorAutoConfiguration,envInfoContributor,management.info-org.springframework.boot.actuate.autoconfigure.InfoContributorProperties,org.springframework.boot.actuate.autoconfigure.HealthIndicatorAutoConfiguration$DiskSpaceHealthIndicatorConfiguration,diskSpaceHealthIndicator,diskSpaceHealthIndicatorProperties,org.springframework.boot.actuate.autoconfigure.HealthIndicatorAutoConfiguration,healthAggregator,management.health.status-org.springframework.boot.actuate.autoconfigure.HealthIndicatorProperties,org.springframework.boot.actuate.autoconfigure.MetricRepositoryAutoConfiguration$FastMetricServicesConfiguration,counterBuffers,gaugeBuffers,actuatorMetricReader,counterService,gaugeService,org.springframework.boot.actuate.autoconfigure.MetricRepositoryAutoConfiguration,org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration,mbeanExporter,objectNamingStrategy,mbeanServer,org.springframework.boot.actuate.autoconfigure.PublicMetricsAutoConfiguration$TomcatMetricsConfiguration,tomcatPublicMetrics,org.springframework.boot.actuate.autoconfigure.PublicMetricsAutoConfiguration,systemPublicMetrics,metricReaderPublicMetrics,org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration$RequestMappingEndpointConfiguration,requestMappingEndpoint,org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration,environmentEndpoint,healthEndpoint,beansEndpoint,infoEndpoint,loggersEndpoint,metricsEndpoint,traceEndpoint,dumpEndpoint,autoConfigurationReportEndpoint,shutdownEndpoint,configurationPropertiesReportEndpoint,endpoints-org.springframework.boot.actuate.endpoint.EndpointProperties,org.springframework.boot.actuate.autoconfigure.EndpointMBeanExportAutoConfiguration,endpointMBeanExporter,auditEventsEndpoint,endpoints.jmx-org.springframework.boot.actuate.autoconfigure.EndpointMBeanExportProperties,org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration,serverProperties,duplicateServerPropertiesDetector,org.springframework.boot.actuate.autoconfigure.ManagementServerPropertiesAutoConfiguration,managementServerProperties,org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration$StringHttpMessageConverterConfiguration,stringHttpMessageConverter,spring.http.encoding-org.springframework.boot.autoconfigure.web.HttpEncodingProperties,org.springframework.boot.autoconfigure.web.JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration,mappingJackson2HttpMessageConverter,org.springframework.boot.autoconfigure.web.JacksonHttpMessageConvertersConfiguration,org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration,messageConverters,org.springframework.boot.actuate.autoconfigure.EndpointWebMvcManagementContextConfiguration,endpointHandlerMapping,mvcEndpoints,environmentMvcEndpoint,heapdumpMvcEndpoint,healthMvcEndpoint,loggersMvcEndpoint,metricsMvcEndpoint,logfileMvcEndpoint,auditEventMvcEndpoint,endpoints.health-org.springframework.boot.actuate.autoconfigure.HealthMvcEndpointProperties,endpoints.cors-org.springframework.boot.actuate.autoconfigure.EndpointCorsProperties,org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$EndpointWebMvcConfiguration,org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextFilterConfiguration,applicationContextIdFilter,org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration,managementContextResolver,managementServletContext,org.springframework.boot.actuate.autoconfigure.MetricExportAutoConfiguration$MetricExportPropertiesConfiguration,spring.metrics.export-org.springframework.boot.actuate.metrics.export.MetricExportProperties,org.springframework.boot.actuate.autoconfigure.MetricExportAutoConfiguration$StatsdConfiguration,org.springframework.boot.actuate.autoconfigure.MetricExportAutoConfiguration,metricWritersMetricExporter,org.springframework.boot.actuate.autoconfigure.MetricFilterAutoConfiguration,metricsFilter,endpoints.metrics.filter-org.springframework.boot.actuate.autoconfigure.MetricFilterProperties,org.springframework.boot.actuate.autoconfigure.TraceRepositoryAutoConfiguration,traceRepository,org.springframework.boot.actuate.autoconfigure.TraceWebFilterAutoConfiguration,webRequestLoggingFilter,management.trace-org.springframework.boot.actuate.trace.TraceProperties,org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration,springApplicationAdminRegistrar,org.springframework.boot.autoconfigure.aop.AopAutoConfiguration$JdkDynamicAutoProxyConfiguration,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.boot.autoconfigure.aop.AopAutoConfiguration,org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration,org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration,persistenceExceptionTranslationPostProcessor,org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration,keyValueMappingContext,redisCustomConversions,redisReferenceResolver,redisConverter,redisKeyValueAdapter,redisKeyValueTemplate,org.springframework.data.web.config.ProjectingArgumentResolverRegistrar,projectingArgumentResolverBeanPostProcessor,org.springframework.data.web.config.SpringDataWebConfiguration,pageableResolver,sortResolver,org.springframework.data.web.config.SpringDataJacksonConfiguration,jacksonGeoModule,org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration,org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration,platformTransactionManagerCustomizers,spring.transaction-org.springframework.boot.autoconfigure.transaction.TransactionProperties,org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$ThymeleafResourceHandlingConfig,org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$ThymeleafWebLayoutConfiguration,layoutDialect,org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$ThymeleafDefaultConfiguration,templateEngine,org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$Thymeleaf3Configuration$Thymeleaf3ViewResolverConfiguration,thymeleafViewResolver,org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$Thymeleaf3Configuration$DefaultTemplateResolverConfiguration,defaultTemplateResolver,org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$Thymeleaf3Configuration,org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration,spring.thymeleaf-org.springframework.boot.autoconfigure.thymeleaf.ThymeleafProperties,org.springframework.boot.autoconfigure.web.HttpEncodingAutoConfiguration,characterEncodingFilter,localeCharsetMappingsCustomizer,org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration,multipartConfigElement,multipartResolver,spring.http.multipart-org.springframework.boot.autoconfigure.web.MultipartProperties,org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration$RestTemplateConfiguration,restTemplateBuilder,org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration]; root of factory hierarchy 2019-07-26 15:27:43.951  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean  : Step-5調用。ApplicationContextAware.setApplicationContext org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@78aab498: startup date [Fri Jul 26 15:27:40 CST 2019]; root of context hierarchy 2019-07-26 15:27:43.953  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean : begin to execute @PostConstruct 2019-07-26 15:27:43.954  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean  : Step-7調用。InitializingBean.afterPropertiesSet 2019-07-26 15:27:43.955  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean  : Step-7調用。相似地,若是bean使用init-method聲明瞭初始化方法,該方法也會被調用 2019-07-26 15:27:43.956  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean : begin to execute initMethod 2019-07-26 15:27:44.083  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean  : Step-6調用。BeanPostProcessor.postProcessBeforeInitialization bean=org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat$$EnhancerBySpringCGLIB$$9aeb279f,beanName=org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat 2019-07-26 15:27:44.104  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean  : Step-8調用。BeanPostProcessor.postProcessAfterInitialization bean=org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat$$EnhancerBySpringCGLIB$$9aeb279f@67aaf882,beanName=org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat 2019-07-26 15:27:44.109  WARN 30704 --- [main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: factory-bean 'org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat' (or a BeanPostProcessor involved) returned null
2019-07-26 15:27:44.111  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean  : Step-10調用。DisposableBean.destroy 2019-07-26 15:27:44.114  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean  : Step-10調用。一樣,若是bean使用destroy-method聲明瞭銷燬方法,該方法也會被調用 2019-07-26 15:27:44.116  INFO 30704 --- [main] c.t.learning.init.spring.SpringInitBean : begin to execute destroyMethod 2019-07-26 15:27:44.219  INFO 30704 --- [main] utoConfigurationReportLoggingInitializer : Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 2019-07-26 15:27:44.290 ERROR 30704 --- [main] o.s.boot.SpringApplication : Application startup failed org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: factory-bean 'org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat' (or a BeanPostProcessor involved) returned null at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:139) ~[spring-boot-1.5.18.RELEASE.jar:1.5.18.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) ~[spring-context-4.3.21.RELEASE.jar:4.3.21.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:124) ~[spring-boot-1.5.18.RELEASE.jar:1.5.18.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.18.RELEASE.jar:1.5.18.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.18.RELEASE.jar:1.5.18.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.18.RELEASE.jar:1.5.18.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.18.RELEASE.jar:1.5.18.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.18.RELEASE.jar:1.5.18.RELEASE] at com.tangcheng.learning.DemoApplication.main(DemoApplication.java:16) [classes/:na] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: factory-bean 'org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat' (or a BeanPostProcessor involved) returned null at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:374) ~[spring-beans-4.3.21.RELEASE.jar:4.3.21.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1178) ~[spring-beans-4.3.21.RELEASE.jar:4.3.21.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1072) ~[spring-beans-4.3.21.RELEASE.jar:4.3.21.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511) ~[spring-beans-4.3.21.RELEASE.jar:4.3.21.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) ~[spring-beans-4.3.21.RELEASE.jar:4.3.21.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) ~[spring-beans-4.3.21.RELEASE.jar:4.3.21.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.21.RELEASE.jar:4.3.21.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) ~[spring-beans-4.3.21.RELEASE.jar:4.3.21.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.21.RELEASE.jar:4.3.21.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:201) ~[spring-boot-1.5.18.RELEASE.jar:1.5.18.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) ~[spring-boot-1.5.18.RELEASE.jar:1.5.18.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:136) ~[spring-boot-1.5.18.RELEASE.jar:1.5.18.RELEASE] ... 8 common frames omitted

Process finished with exit code 1

 
 

 

 反思:仔細從報錯信息中獲取線索,是解決問題是一個便捷的途徑

相關文章
相關標籤/搜索