简体   繁体   中英

Tomcat servlet works on local machine, breaks on server

I'm assuming I'm doing something simple and stupid since I'm new to this. But I have a working Tomcat servlet. On my local machine, when the connection is created with:

var webSocket = new WebSocket("ws://localhost:8080/myapp/websocketendpoint");

it works just fine. In fact, I accidentally loaded it to the server with that and of course it still worked:P.

However, whenever I try to run the servlet on the server itself:

var webSocket = new WebSocket("ws://11.22.33.44:8080/myapp/websocketendpoint");

it dies, saying that a connection cannot be established to the server. To be honest, I used this information to set up the server.

Okay, so hopefully this experience will help someone else. Despite the estoric error message, I just needed to update my build.properties files... which is essence just updates the build.xml file.

So any errors over there can cause really strange errors it seems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM