4 Replies Latest reply on Apr 26, 2011 1:54 AM by ffang

    Error on connecting with STOMP

    ss5nembokid

      Hi!

       

      I have download and install FUSE ESB 4.3.0.

      I deploy and use bridge-camel example of FUSE ESB 3.5.0 because the version of FUSE 4.3.0 doesn't work: Maven can't find all files needed for that version.

       

      I write a Java program that consumes messages from the queue in the example using JMS, and all works.

       

      Then I try to use STOMP with PHP to do the same thing I did with Java.

       

      But it doesn't work.

      I tried to connect to STOMP port 61613 with Telnet but if I send STOMP commands I don't receive any answers.

       

      So I saw in FUSE ESB console this message:

       

      karaf@root> Exception in thread "ActiveMQ Transport Server Thread Handler: stomp

      ://localhost:61613" java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/

      HierarchicalStreamDriver

              at org.apache.activemq.transport.stomp.StompTransportFactory.compositeCo

      nfigure(StompTransportFactory.java:44)

              at org.apache.activemq.transport.TransportFactory.serverConfigure(Transp

      ortFactory.java:270)

              at org.apache.activemq.transport.tcp.TcpTransportServer.handleSocket(Tcp

      TransportServer.java:420)

              at org.apache.activemq.transport.tcp.TcpTransportServer$1.run(TcpTranspo

      rtServer.java:353)

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

      Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.io.Hierarc

      hicalStreamDriver

              at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(Bundl

      eLoader.java:506)

              at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.

      java:422)

              at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.

      java:410)

              at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(De

      faultClassLoader.java:107)

              at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

              ... 5 more

       

      The configuration of ActiveMQ broker seems to be ok: I used JConsole and I saw the STOMP connector and so on...

       

      I tried to download ActiveMQ alone from http://activemq.apache.org/.

      I tested it with a Java program to send and to get messages with JMS using a queue.

      I tested it using STOMP with Telnet and with PHP.

      All works...

       

      What I have to do to work with STOMP and FUSE ESB 4.3.0?

      Does the basic configuration of FUSE ESB 4.3.0 miss some jar that I have to install?

       

      Sorry about my english, I'm an italian student and I'm new about ESB.

       

      I how there is someone that can help me here.

       

      Thank you

       

      "News":

       

      I have installed FUSE ESB 3.5.0 and with this version is all ok.

       

      Why with FUSE ESB version 4.3.0 STOMP has that problem?

      Is it only a problem of missing jars?

       

      Thank you

       

      Edited by: ss5nembokid on Oct 25, 2010 1:40 PM

       

      "News 2"

       

      I taked from lib directory in Fuse ESB 3.5.0 the file xstream-1.3.jar and I put it to lib directory of Fuse ESB 4.3.0 and now the example works and I can take without errors the messages from the queue even with a PHP script using STOMP

      ( http://stomp.fusesource.org/documentation/php/index.html )

       

      Edited by: ss5nembokid on Oct 26, 2010 4:21 PM

        • 1. Re: Error on connecting with STOMP
          guest

          Please help with this issue.  I'm having the exact same problem but putting in the xstream jar in ./lib isn't working for me. thanks!

          • 2. Re: Error on connecting with STOMP
            ffang

            Hi,

             

            Please tell us exact FUSE ESB version you're using and how your customer bundle looks like, my gut feeling is that your bundle miss some package import.

             

            Freeman

            • 3. Re: Error on connecting with STOMP
              guest

              Thanks for helping.  I'm using servicemix 4.3.  I basically use it out of the box and have some bundles and one that starts some camel routes.  One of the clients connecting to my smx instance is using stomp.  I've done this before with servicemix 4.2 and no problems.  The exception noted by the author of this thread happens right when the stomp client is connected to the amq broker.... so it's not based on some bundle startup.  Im using the default activemq-broker.xml that comes with servicemix 4.3.

               

              Thanks!

              • 4. Re: Error on connecting with STOMP
                ffang

                Hi,

                 

                I think I know what's the problem now.

                 

                activemq-core bundle now have some optional import like

                com.thoughtworks.xstream;resolution:=optional,

                     com.thoughtworks.xstream.converters;resolution:=optional,

                     com.thoughtworks.xstream.io;resolution:=optional,

                     com.thoughtworks.xstream.io.json;resolution:=optional,

                     com.thoughtworks.xstream.io.xml;resolution:=optional,

                those optional import package isn't installed by default as they're just optional necessary.

                 

                That's why when your stomp client connect to the broker, you see such exception as stomp need those package import.

                 

                You need ensure you have xtream bundle installed also before your stomp client connect.

                 

                I assume you're using 4.3.1-fuse-01-09

                 

                edit

                $FUSE_ESB/ystem/org/apache/servicemix/apache-servicemix/4.3.1-fuse-01-09/apache-servicemix-4.3.1-fuse-01-09-activemq-features.xml

                 

                added

                 

                 

                into activemq feature.

                 

                Btw, we already created a jira ticket[1] to track this issue.

                 

                http://fusesource.com/issues/browse/MB-868

                 

                Freeman

                 

                Edited by: ffang on Apr 26, 2011 5:52 AM