spring-guides / gs-messaging-stomp-websocket

Using WebSocket to build an interactive web application :: Learn how to the send and receive messages between a browser and the server over a WebSocket

Home Page:http://spring.io/guides/gs/messaging-stomp-websocket/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't connect to WebSocket - Gives me 404 not found for /hello/info

bluechips23 opened this issue · comments

I want to test out the SockJS-WebSocket messaging as described here but each time I clicked on the connect button, I kept on getting the frustrating error

GET http://localhost:8080/myapp/hello/info 404 (not found). Whoops! Lost connection to undefined

I thought I must be doing something wrong, but I followed the steps to the T.

Finally, I downloaded the gs-messaging-stomp-websocket directory from the tutorial here, went to complete directory where all the files are, and launched it with mvn spring-boot:run. It launched normally. I went to http://localhost:8080 and clicked on the connect button again, and I got the same frustrating error as above. This time, I didn't change a single thing about the configuration or the code.

I tried to troubleshoot using some of the Stack Overflow threads here, here and here and unfortunately, I hit a wall as none of the suggested solutions work for me.

So please help me and let me know what I am doing wrong, and how to solve this issue.

Why http://localhost:8080/myapp/hello/info? The instructions:

Now that the service is running, point your browser at http://localhost:8080 and click the "Connect" button.

Hi rstoyanchev,

I wasn't going directly going to http://localhost:8080/myapp/hello/info. It's just when I click on the "Connect" button, I see on my Chrome DEV console that it tries to go to the above location which causes to give me that 404 error. The HTML file was unmodified when it was downloaded from the website.

However, I think I fixed the issues today. Not sure what exactly happened but in my maven repository directory I realized that most of the actual jars that were downloaded for Spring were of version 4.0.8 or less.

I did a clean install and re-downloaded the repositories and it's working perfectly as of now. So, this issue is resolved.

The connect button should send you to http://localhost:8080/hello/info. Not sure where you got "/myaap" from. At any rate glad it's working for you now.

I'm also facing same issue

Any resolution provided for this issue?

Hi rstoyanchev,
I'm not able to do WebSocket connection.
could you please help me here StackOverflow:How to properly configure Stomp and SockJS endpoint in Spring MVC?

I am facing the same problem. How can I solve this ?

I am facing the same problem. Example is not working.

Hi rstoyanchev,

I wasn't going directly going to http://localhost:8080/myapp/hello/info. It's just when I click on the "Connect" button, I see on my Chrome DEV console that it tries to go to the above location which causes to give me that 404 error. The HTML file was unmodified when it was downloaded from the website.

However, I think I fixed the issues today. Not sure what exactly happened but in my maven repository directory I realized that most of the actual jars that were downloaded for Spring were of version 4.0.8 or less.

I did a clean install and re-downloaded the repositories and it's working perfectly as of now. So, this issue is resolved.

please tell us, how to downgrade