zyro23 / grails-spring-websocket

93 stars 28 forks source link

Getting this error on grails 3.1.5 #36

Closed davydotcom closed 8 years ago

davydotcom commented 8 years ago

ApplicationContextException: Failed to start bean 'stompBrokerRelayMessageHandler'; nested exception is java.lang.NoClassDefFoundError: reactor/io/net/impl/netty/tcp/NettyTcpClient
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:176)
    at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51)
    at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:346)
    at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149)
    at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:112)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:852)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:140)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:55)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:374)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:363)
    at grails.boot.GrailsApp$run.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
    at morpheus.ui.Application.main(Application.groovy:8)
Caused by: java.lang.NoClassDefFoundError: reactor/io/net/impl/netty/tcp/NettyTcpClient
    at org.springframework.messaging.tcp.reactor.Reactor2TcpClient.<clinit>(Reactor2TcpClient.java:80)
    at org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler$StompTcpClientFactory.create(StompBrokerRelayMessageHandler.java:960)
    at org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler.startInternal(StompBrokerRelayMessageHandler.java:383)
    at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.start(AbstractBrokerMessageHandler.java:164)
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173)
    ... 19 common frames omitted
Caused by: java.lang.ClassNotFoundException: reactor.io.net.impl.netty.tcp.NettyTcpClient
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 24 common frames omitted
zyro23 commented 8 years ago

thanks for reporting!

looks like reactor-net (needed for a real broker impl instead of just the default in-memory one) is missing on the classpath.

may i ask from what version you are upgrading?

adding compile "io.projectreactor:reactor-net" to your dependencies should help.

ill keep looking for the cause of this change and depending on the outcome fix/align that or just document that the reactor-net dependency has to be added if a real broker is to be used.

zyro23 commented 8 years ago

added readme notes reg. the required dependencies for using a full-featured broker after discussing with @davydotcom - https://github.com/zyro23/grails-spring-websocket/commit/cab124fa48128771103c8896dfb3b86b3106db0d#diff-04c6e90faac2675aa89e2176d2eec7d8

thanks again.