java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@e34b1b: startup date [Sun Sep 02 14:12:30 CST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@1e68d87
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.bx.Application]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.cloud.netflix.zuul.ZuulConfiguration
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/ServletRegistrationBean
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.embedded.ServletRegistrationBean
解决方法:
原因是springboot和springcloud版本不兼容了,我的springboot版本是1.5.6,而springcloud版本是Brixton.SR5,使用@EnableZuulProxy后启动报错如上所示,我的解决方法就是把Brixton.SR5改成Dalston.SR1即可。springboot和springcloud版本兼容参考:http://www.yayihouse.com/yayishuwu/chapter/1557
本文链接:http://www.yayihouse.com/yayishuwu/chapter/1556