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 Newbie

      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