zyro23 / grails-spring-websocket

93 stars 28 forks source link

Connecting to a ActiveMQ gives ClassNotFoundException #26

Closed dtamm closed 9 years ago

dtamm commented 9 years ago

Having a Grails 2.5.0 Appliation with the 1.3 Version of the plugin, wanted to setup an activemq for usage with several webapplications... getting this ClassNotFoundException:

|Loading Grails 2.5.0
|Configuring classpath
.
|Environment set to development
.................................
|Packaging Grails application
.......................................
|Running Grails application
|Enabling Tomcat NIO connector
Error |
2015-08-04 18:22:18,160 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate  - HHH000388: Unsuccessful: alter table filterkriterium add constraint FK_7300abuetfts0t3ree7asooht foreign key (idx_abfrage_karte) references abfrage_karte (idx_abfrage_karte)
Error |
2015-08-04 18:22:18,162 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate  - Cannot add foreign key constraint
Error |
2015-08-04 18:22:27,596 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener  - Error initializing the application: Failed to start bean 'stompBrokerRelayMessageHandler'; nested exception is java.lang.NoClassDefFoundError: reactor/io/encoding/Codec
Message: Failed to start bean 'stompBrokerRelayMessageHandler'; nested exception is java.lang.NoClassDefFoundError: reactor/io/encoding/Codec
    Line | Method
->>  262 | run       in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    744 | run       in java.lang.Thread
Caused by NoClassDefFoundError: reactor/io/encoding/Codec
->>  800 | defineClass in java.lang.ClassLoader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    142 | defineClass in java.security.SecureClassLoader
|    449 | defineClass in java.net.URLClassLoader
|     71 | access$100 in     ''
|    361 | run . . . in java.net.URLClassLoader$1
|    355 | run       in     ''
|    354 | findClass in java.net.URLClassLoader
|    425 | loadClass in java.lang.ClassLoader
|    262 | run . . . in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    744 | run       in java.lang.Thread
Caused by ClassNotFoundException: reactor.io.encoding.Codec
->>  366 | run       in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    355 | run       in     ''
|    354 | findClass in java.net.URLClassLoader
|    425 | loadClass in java.lang.ClassLoader
|    800 | defineClass in     ''
|    142 | defineClass in java.security.SecureClassLoader
|    449 | defineClass in java.net.URLClassLoader
|     71 | access$100 in     ''
|    361 | run . . . in java.net.URLClassLoader$1
|    355 | run       in     ''
|    354 | findClass in java.net.URLClassLoader
|    425 | loadClass in java.lang.ClassLoader
|    262 | run . . . in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    744 | run       in java.lang.Thread
Error |
Forked Grails VM exited with error

Tried it with ActiveMQ Version 5.1.1 on default config (guest / password etc.). Any hints on this one? (I know, it seesm to be missing one or more libraries, but maybe you know which one(s)!).

zyro23 commented 9 years ago

try compile "org.projectreactor:reactor-net:1.1.5.RELEASE". it is marked as an optional dependency of spring-messaging-4.1.5.

dtamm commented 9 years ago

Thanks zyro, that did the trick! Though the activemq now makes weird topic names (my topic is called "kundeBenachrichtigung" and the activemq makes "ActiveMQ.Advisory.Consumer.Topic.kundeBenachrichtigung" of it... but seems to be a config of the activemq).

dtamm commented 9 years ago

THough this ticket is alredy closed, but have you ever got it working with an activemq relay? i was working on it the whole day but couldn't get it working till now ;-(

zyro23 commented 9 years ago

only tried successfully with rabbitmq as a real broker / relay yet. what exactly is not working as supposed to?

dtamm commented 9 years ago

Already figured out what the problem was... i didnt have both of my projects connected to the stomp relay using the ActiveMQ, now it is working :)