6 Replies Latest reply on Mar 9, 2013 5:51 AM by will.tatam

    HornetQ 2.2.14 and JBoss AS7 7.1.1. Stomp 403 Forbidden Issue

    andrew.s

      Hello all,

       

      I am attempting to get Stomp WebSockets working in JBoss AS7 7.1.1. to use the Stomp WebSockets Javascript library.  I have followed a couple of examples on getting Stomp WebSockets working and it seems to be configured correctly, but every time I try to connect to the URL, I get a 403 Forbidden error.  I initially attempted to do this with AS7 with the latest version of the Stomp JS library.  When that didn't work, I attempted to use the example that came out of the box with HornetQ.  I get the same 403 Forbidden error.  I have even double checked that the username/password were correct.  I also attempted to upgrade the HornetQ example to the latest JS library and it still gave me the 403 error.

       

      I am using Firefox 14.0.1 without any modifications other than Firebug.

       

      For AS7, I have the Netty Acceptor configured:

       

      <netty-acceptor name="netty-stomp" socket-binding="messaging-stomp">

            <param key="protocol" value="stomp_ws"/>

      </netty-acceptor>

       

      I have the port configured:

       

        <socket-binding name="messaging-stomp" port="61613"/>

       

       

      I have tried both 61613 and 61614 without any luck.

       

      And for Messaging I have the default security settings:

       

                      <security-settings>

                          <security-setting match="#">

                              <permission type="send" roles="guest"/>

                              <permission type="consume" roles="guest"/>

                              <permission type="createNonDurableQueue" roles="guest"/>

                              <permission type="deleteNonDurableQueue" roles="guest"/>

                          </security-setting>

                      </security-settings>

       

      I am attempting to connect to the test queue defined in standalone-full.xml.  I have created a new user via the add-user script and added that user to the guest roles.  I have verified that the user shows up in the application-users.properties and application-roles.properties.  When attempting to connect via Stomp JS, I execute the following...not even sending/receiving messages, just trying to connect:

       

              var url = "ws://127.0.0.1:61613/stomp";
              var client = Stomp.client(url);
             
              var error_callback = function(error) {
                  // display the error's message header:
                  alert(error);
                };

              var connect_callback = function(frame) {
                  alert("connected");
                };
                 
              client.connect("myuser", "mypassword", connect_callback, error_callback);

       

       

      The error_callback gets called with the "Whoops...disconnected" error out of Stomp JS and in the Firefox web console, I see that I get an http://127.0.0.1:61613/stomp 403 Forbidden error.  I have also tried localhost instead of IP.  I haven't tried the actual machine IP.

       

      Any help would be appreciated.  Hopefully I provided all the information you need, but if you need any more, let me know.

       

      Thanks,

      Andrew

        • 1. Re: HornetQ 2.2.14 and JBoss AS7 7.1.1. Stomp 403 Forbidden Issue
          jmesnil

          Web Socket protocol was not working with the latest Chrome in HornetQ 2.2.14.

          It has been updated in HornetQ 2.2.19 (https://issues.jboss.org/browse/HORNETQ-819)

          1 of 1 people found this helpful
          • 2. Re: HornetQ 2.2.14 and JBoss AS7 7.1.1. Stomp 403 Forbidden Issue
            andrew.s

            I'm using the latest Firefox 14.0.1.  I meant to put that in the original, but am not seeing it either.  Maybe forgot or getting lost in too much detail.  Do you know if the latest Firefox is having the same issue as Chrome?  I can downgrade my Firefox version....I just need HTML5 and WebSockets support.

             

            The other thing I thought about after posting, is there any kind of cross domain scripting issue involved here?  I opened the HTML as a file off of the file system, not off of a server, so wasn't sure if that would play into it or not.  I can certainly deploy the HTML to the AS7 server.

            • 3. Re: HornetQ 2.2.14 and JBoss AS7 7.1.1. Stomp 403 Forbidden Issue
              andrew.s

              OK...I was able to test with stand alone HornetQ 2.2.19 and my connector code worked fine.  I wanted to use an MDB to listen for the incoming messages, which is why I was using AS7.  Is there any way I can replace the 2.2.13 distro that comes with AS7 7.1.1. with the 2.2.19 build?

               

              I attempted to get the AS7 7.2.0 nightly build that comes with HQ 2.2.19, but that gave me other errors.  I know there are ways to get an AS7 MDB to connect to a remote HQ instance, but it is more work than I want to go through right now because this is mostly a POC endeavour.

              • 4. Re: HornetQ 2.2.14 and JBoss AS7 7.1.1. Stomp 403 Forbidden Issue
                sdonn

                I have it working under AS7 7.1 by updating the org.hornetq module's jar with hornetq-core-2.2.19.Final.jar and changing the dependency on org.jboss.netty to a new io.netty module.  That module I created by copying the org.jboss.netty module and using netty-3.4.5.Final.jar.  Note: leave the hornetq jms and ra jars as is.

                 

                I get a bunch of java.nio.channels.ClosedChannelException when running the browsertests but it is usable for now.

                • 5. Re: HornetQ 2.2.14 and JBoss AS7 7.1.1. Stomp 403 Forbidden Issue
                  andrew.s

                  Thanks for the info.  Since this is a PoC for my project, I just used Apache Apollo and it worked out of the box.  By the time we are really ready to start making it production ready, I'm figured AS 7.2 will be further along and it has 2.2.19 (at a minimum) built in.

                  • 6. Re: HornetQ 2.2.14 and JBoss AS7 7.1.1. Stomp 403 Forbidden Issue
                    will.tatam

                    I'm trying to run a similar test under 7.1.3 and I'm also getting a 4.0.3 forbidden despite 7.1.3 running  hornetq 2.2.21

                     

                    GET / HTTP/1.1

                    Upgrade: websocket

                    Connection: Upgrade

                    Host: localhost:61613

                    Origin: null

                    Sec-WebSocket-Protocol: v10.stomp, v11.stomp

                    Pragma: no-cache

                    Cache-Control: no-cache

                    Sec-WebSocket-Key: FFInyRI3m4c0EFXyEi5ubQ==

                    Sec-WebSocket-Version: 13

                    Sec-WebSocket-Extensions: x-webkit-deflate-frame

                     

                    HTTP/1.1 403 Forbidden

                    Content-Length: 13

                     

                    403 Forbidden