Question

I'm struggling to run grizzly-websockets-chat. I've successfully compiled the sample. HttpServer.createSimpleServer is running and serving a test index.html on localhost:8080. WebSocketEngine.getEngine().register("/chat", chatApplication) executes without complaint. However, localhost:8080/chat returns "Resource identified by path '/chat', does not exist.". This is not under Glassfish - just standalone Grizzly/2.2.19.

Comments in some places suggest that websocket support is off by default - I'm unable to determine how to turn it on outside of Glassfish. I have only the test index.html in docroot.. is anything else required?

I'm not running anything special on the client side - no js, nothing. I've not seen any such thing in the sample. Surprisingly, I've not found a good doc or running example. Maybe is a user problem? ;/

Looks like websocket code may be being invoked:

$ java -jar ./tyrus-client-cli-1.1.jar ws://localhost:8080/chat 
# Connecting to ws://localhost:8080/chat... 
# Failed to connect to ws://localhost:8080/chat due to Handshake error

Any help much appreciated!

Was it helpful?

Solution

Change your request URI to ws://localhost:8080/grizzly-websockets-chat/chat.

The ChatApplication has the following defined for isApplicationRequest():

@Override
public boolean isApplicationRequest(HttpRequestPacket request) {
    return "/grizzly-websockets-chat/chat".equals(request.getRequestURI());
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top