我正在使用RabbitMQ设置Springboot 2.1.4。该项目可以通过简单的代理正常运行,但是在通过RabbitMQ切换到Stomp代理中继时,应用程序启动失败,并出现以下错误。
2019-04-19 18:32:36.841信息80706 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor:关闭ExecutorService'clientOutboundChannelExecutor' 2019-04-19 18:32:36.841信息80706 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor:关闭ExecutorService'clientInboundChannelExecutor' 2019-04-19 18:32:36.845信息80706 --- [main] o.apache.catalina.core.StandardService:停止服务[Tomcat] 2019-04-19 18:32:36.860 INFO 80706 --- [main] ConditionEvaluationReportLoggingListener: 启动ApplicationContext时出错。要显示条件报告,请在启用“调试”的情况下重新运行您的应用程序。 2019-04-19 18:32:36.871错误80706 --- [main] o.s.boot.SpringApplication:应用程序运行失败 org.springframework.context.ApplicationContextException:无法启动bean'stompBrokerRelayMessageHandler';嵌套的异常是java.lang.NoClassDefFoundError:io / netty / util / concurrent / EventExecutor 在org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185)〜[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE] 在org.springframework.context.support.DefaultLifecycleProcessor.access $ 200(DefaultLifecycleProcessor.java:53)〜[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE] 在org.springframework.context.support.DefaultLifecycleProcessor $ LifecycleGroup.start(DefaultLifecycleProcessor.java:360)〜[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE] 在org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)〜[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE] 在org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)〜[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE] 在org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:893)〜[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE] 在org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163)〜[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE] 在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)〜[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE] 在org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)〜[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE] 在org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)上[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE] 在org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)上[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE] 在org.springframework.boot.SpringApplication.run(SpringApplication.java:316)上[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE] 在org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)上[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE] 在org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)上[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE] 在com.sand.SpringWebSockets.SpringWebSocketsApplication.main(SpringWebSocketsApplication.java:10)上[classes /:na] 造成原因:java.lang.NoClassDefFoundError:io / netty / util / concurrent / EventExecutor 在org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler.initTcpClient(StompBrokerRelayMessageHandler.java:435)〜[spring-messaging-5.1.6.RELEASE.jar:5.1.6.RELEASE] 在org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler.startInternal(StompBrokerRelayMessageHandler.java:401)〜[spring-messaging-5.1.6.RELEASE.jar:5.1.6.RELEASE] 在org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.start(AbstractBrokerMessageHandler.java:186)〜[spring-messaging-5.1.6.RELEASE.jar:5.1.6.RELEASE] 在org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)〜[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE] ...省略了14个通用框架 引起原因:java.lang.ClassNotFoundException:io.netty.util.concurrent.EventExecutor 在java.net.URLClassLoader.findClass(URLClassLoader.java:381)〜[na:1.8.0_161] 在java.lang.ClassLoader.loadClass(ClassLoader.java:424)〜[na:1.8.0_161] 在sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:338)〜[na:1.8.0_161] 在java.lang.ClassLoader.loadClass(ClassLoader.java:357)〜[na:1.8.0_161] ...省略了18个常见框架
答案 0 :(得分:0)
还需要添加一个依赖项。 可能是您错过了这个。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-reactor-netty</artifactId>
</dependency>