haluomao / bugbag

bug bag
0 stars 0 forks source link

SpringBoot start failed #1

Closed haluomao closed 4 years ago

haluomao commented 4 years ago

2020-03-06 11:38:40.624 ERROR 53077 [main] --- o.s.b.f.s.DefaultListableBeanFactory : [][] Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@d1f74b8: startup date [Fri Mar 06 11:38:38 UTC 2020]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:404) at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97) at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554) at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:961) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523) at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:968) at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1033) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:555) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:372) at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1187) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1176) at com.baidu.bce.acupiat.mp.caseplat.CasePlatApplication.main(CasePlatApplication.java:18) 2020-03-06 11:38:40.629 ERROR 53077 [main] --- .b.b.p.w.e.BootstarpExceptionRunlistener : [][] bootstrap start up fail org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.baidu.bce.acupiat.mp.caseplat.CasePlatApplication]; nested exception is java.lang.IllegalStateException: Error processing condition on org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:604) at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:538) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:184) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:308) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:270) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:372) at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1187) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1176) at com.baidu.bce.acupiat.mp.caseplat.CasePlatApplication.main(CasePlatApplication.java:18) Caused by: java.lang.IllegalStateException: Error processing condition on org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64) at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:216) at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:595) ... 15 common frames omitted Caused by: java.lang.ClassCastException: java.lang.ClassNotFoundException cannot be cast to java.lang.Class at org.springframework.boot.actuate.autoconfigure.endpoint.condition.OnEnabledEndpointCondition.getEndpointType(OnEnabledEndpointCondition.java:101) at org.springframework.boot.actuate.autoconfigure.endpoint.condition.OnEnabledEndpointCondition.getEndpointAttributes(OnEnabledEndpointCondition.java:93) at org.springframework.boot.actuate.autoconfigure.endpoint.condition.OnEnabledEndpointCondition.getMatchOutcome(OnEnabledEndpointCondition.java:57) at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ... 18 common frames omitted 2020-03-06 11:38:40.633 ERROR 53077 [main] --- o.s.boot.SpringApplication : [][] Application startup failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.baidu.bce.acupiat.mp.caseplat.CasePlatApplication]; nested exception is java.lang.IllegalStateException: Error processing condition on org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:604) at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:538) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:184) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:308) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:270) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:372) at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1187) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1176) at com.baidu.bce.acupiat.mp.caseplat.CasePlatApplication.main(CasePlatApplication.java:18) Caused by: java.lang.IllegalStateException: Error processing condition on org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64) at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:216) at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:595) ... 15 common frames omitted Caused by: java.lang.ClassCastException: java.lang.ClassNotFoundException cannot be cast to java.lang.Class at org.springframework.boot.actuate.autoconfigure.endpoint.condition.OnEnabledEndpointCondition.getEndpointType(OnEnabledEndpointCondition.java:101) at org.springframework.boot.actuate.autoconfigure.endpoint.condition.OnEnabledEndpointCondition.getEndpointAttributes(OnEnabledEndpointCondition.java:93) at org.springframework.boot.actuate.autoconfigure.endpoint.condition.OnEnabledEndpointCondition.getMatchOutcome(OnEnabledEndpointCondition.java:57) at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ... 18 common frames omitted Disconnected from the target VM, address: '127.0.0.1:55413', transport: 'socket'

Process finished with exit code 1

haluomao commented 4 years ago

原因:actuator也有个autoconfigure版本,和spring-boot-autoconfigure冲突了。 解决一:删除actuator的autoconfigure版本包,但是指不定下次又会被重新import 解决二: 先定位到autoconfigure的版本,然后通过版本追溯到parent dependency,之后exclude artifactId。

org.springframework.statemachine spring-statemachine-starter 2.1.3.RELEASE org.springframework.boot spring-boot-actuator-autoconfigure