2020-11-23

使用spring状态机出现异常

导入状态机的依赖后正常使用提供的工具类,在启动SpringBoot的时候报如下异常

2020-11-23 20:17:07.562 ERROR 5040 --- [   main] o.s.b.f.s.DefaultListableBeanFactory  : Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exceptionjava.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5af97850: startup date [Mon Nov 23 20:17:06 CST 2020]; root of context hierarchy	at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:414) [spring-context-4.3.12.RELEASE.jar:4.3.12.RELEASE]	at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97) ~[spring-context-4.3.12.RELEASE.jar:4.3.12.RELEASE]	at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578) [spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554) [spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:961) [spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523) [spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.destroySingletons(FactoryBeanRegistrySupport.java:230) [spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:968) [spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]	at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1030) [spring-context-4.3.12.RELEASE.jar:4.3.12.RELEASE]	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:556) [spring-context-4.3.12.RELEASE.jar:4.3.12.RELEASE]	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]	at com.wy.lifecycle.MainApplication.main(MainApplication.java:14) [classes/:na]

bean还没有开始初始化就已经开始报错,然后想到可能是依赖的包的问题,换了就解决了
之前的版本为:

<dependency>	<groupId>org.springframework.statemachine</groupId>	<artifactId>spring-statemachine-starter</artifactId>	<version>2.1.3.RELEASE</version></dependency>

替换的版本为:

<dependency>   <groupId>org.springframework.statemachine</groupId>   <artifactId>spring-statemachine-core</artifactId>   <version>1.2.0.RELEASE</version></dependency>








原文转载:http://www.shaoqun.com/a/492885.html

美菜:https://www.ikjzd.com/w/1874

myshow:https://www.ikjzd.com/w/2235

asinseed:https://www.ikjzd.com/w/533


导入状态机的依赖后正常使用提供的工具类,在启动SpringBoot的时候报如下异常2020-11-2320:17:07.562ERROR5040---[main]o.s.b.f.s.DefaultListableBeanFactory:Destroymethodonbeanwithname'org.springframework.boot.autoconfigure.internalCac
李群:李群
adore:adore
受新冠肺炎影响,洛杉矶港二月份集装箱货量预计将下降25%:受新冠肺炎影响,洛杉矶港二月份集装箱货量预计将下降25%
海口哪里有冰雪王国?海南海口看冰雪世界去哪里?:海口哪里有冰雪王国?海南海口看冰雪世界去哪里?
已有出口商投资数百万,埃塞俄比亚或是下一个"黄金地"!:已有出口商投资数百万,埃塞俄比亚或是下一个"黄金地"!

No comments:

Post a Comment