10 Replies Latest reply on Apr 27, 2011 11:12 PM by clebert.suconic

    stomp-websockets example

    cvasilak

      Hi there,

       

      first congrats for the new release  2.2.2.Fina! 

       

      I tried to run the stomp-websockets example and particular the web page part. Unfortunately when I click connect on the web page I get this on the error log:

       

      Opening Web Socket...

      Web Socket Opened...

      >>> CONNECT

      login: guest

      passcode: guest

       

      Whoops! Lost connection to ws://localhost:61614/stomp

       

       

      On the server console  I get an exception ( Invalid STOMP frame) (the server was started with ./run.sh ../examples/jms/stomp-websockets/server0 to enable the WS connector as suggested in the docs)

       

      .....

      .....

      [main] 19:04:10,264 INFO [org.hornetq.core.remoting.impl.netty.NettyAcceptor]  Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost:61614 for STOMP_WS protocol

      [main] 19:04:10,267 INFO [org.hornetq.core.remoting.impl.netty.NettyAcceptor]  Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost:5445 for CORE protocol

      [main] 19:04:10,268 INFO [org.hornetq.core.server.impl.HornetQServerImpl]  Server is now live

      [main] 19:04:10,269 INFO [org.hornetq.core.server.impl.HornetQServerImpl]  HornetQ Server version 2.2.2.Final (super-hornetq-fighter, 122) [ad70e4fb-5c79-11e0-bf70-005056c00008] started


      org.hornetq.core.protocol.stomp.StompException: Invalid STOMP frame: C,O,N,N,E,C,T,E,D,10,s,e,s,s,i,o,n,:,2,8,4,2,9,1,9,1,4,10,10,0,10,

                at org.hornetq.core.protocol.stomp.StompDecoder.throwInvalid(StompDecoder.java:496)

                at org.hornetq.core.protocol.stomp.StompDecoder.decode(StompDecoder.java:305)

                at org.hornetq.core.protocol.stomp.WebSocketStompFrameEncoder.encode(WebSocketStompFrameEncoder.java:58)

                at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:66)

                at org.jboss.netty.channel.Channels.write(Channels.java:611)

                at org.jboss.netty.channel.Channels.write(Channels.java:578)

                at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:259)

                at org.hornetq.core.remoting.impl.netty.NettyConnection.write(NettyConnection.java:211)

                at org.hornetq.core.protocol.stomp.StompProtocolManager.send(StompProtocolManager.java:285)

                at org.hornetq.core.protocol.stomp.StompProtocolManager$1.done(StompProtocolManager.java:664)

                at org.hornetq.core.persistence.impl.journal.OperationContextImpl.executeOnCompletion(OperationContextImpl.java:188)

                at org.hornetq.core.persistence.impl.journal.JournalStorageManager.afterCompleteOperations(JournalStorageManager.java:429)

                at org.hornetq.core.protocol.stomp.StompProtocolManager.sendReply(StompProtocolManager.java:652)

                at org.hornetq.core.protocol.stomp.StompProtocolManager.handleBuffer(StompProtocolManager.java:238)

                at org.hornetq.core.protocol.stomp.StompConnection.bufferReceived(StompConnection.java:269)

                at org.hornetq.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:459)

                at org.hornetq.core.remoting.impl.netty.HornetQChannelHandler.messageReceived(HornetQChannelHandler.java:73)

                at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:287)

                at org.hornetq.core.protocol.stomp.WebSocketServerHandler.handleWebSocketFrame(WebSocketServerHandler.java:135)

                at org.hornetq.core.protocol.stomp.WebSocketServerHandler.messageReceived(WebSocketServerHandler.java:59)

                at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:201)

                at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)

                at org.jboss.netty.handler.codec.replay.ReplayingDecoder.unfoldAndfireMessageReceived(ReplayingDecoder.java:526)

                at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:507)

                at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:444)

                at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)

                at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)

                at org.jboss.netty.channel.socket.oio.OioWorker.run(OioWorker.java:90)

                at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)

                at org.jboss.netty.util.VirtualExecutorService$ChildExecutorRunnable.run(VirtualExecutorService.java:181)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                at java.lang.Thread.run(Thread.java:680)

       

       

      The command line example works OK, that is it successfully sends the message to the topic.

       

      runExample:

           [java] serverProps = -XX:+UseParallelGC -Xms256M -Xmx256M -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Dcom.sun.management.jmxremote -Djava.util.logging.config.file=/Applications/hornetq-2.2.2.Final/examples/common/config/logging.properties -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

           [java] Apr 1, 2011 7:04:43 PM org.hornetq.common.example.HornetQExample run

           [java] INFO: hornetq.example.runServer is false

           [java] Apr 1, 2011 7:04:43 PM org.hornetq.common.example.HornetQExample getContext

           [java] INFO: using server0/client-jndi.properties for jndi

           [java] Sent message: message sent from a Java application at Fri Apr 01 19:04:44 EEST 2011

           [java] Received message: message sent from a Java application at Fri Apr 01 19:04:44 EEST 2011

           [java] example complete

           [java]

           [java] #####################

           [java] ###    SUCCESS!   ###

           [java] #####################

       

       

      Regards,

      Christos