Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nettosphere "400 Bad Request" when sending message through WebSocket (AHC) #13

Closed
ncolomer opened this issue Apr 28, 2012 · 3 comments
Closed
Labels

Comments

@ncolomer
Copy link

I am trying to run integration tests on my realtime resources using Nettosphere and AHC.
I face a strange server-side error when sending data from client to server (largely based on the Nettosphere's WebSocket unit test NettyAtmosphereTest#suspendWebSocketTest()).

WebSocketUpgradeHandler handler = new WebSocketUpgradeHandler.Builder()
        .addWebSocketListener(listener).build();
WebSocket webSocket = client.prepareGet("ws://localhost:8080/")
        .execute(handler).get();
webSocket.sendTextMessage(clientBounds);

While executing, this outputs the following message in the console:

...
17:15:33.250 [pool-9-thread-1] DEBUG o.a.nettosphere.NettyWebSocket - The WebSocket handshake succeeded but the dispatched URI failed Bad Request:400. The WebSocket connection is still open and client can continue sending messages.
17:15:33.250 [pool-9-thread-1] WARN  o.a.w.protocol.SimpleHttpProtocol - Status code higher than 400 Status 400 Message Bad Request
...

Server-side, the WebSocketEventListener I set in the returned SuspendResponse never receive any message.

You can find the full source code of the related (failing) test here.

I use the following versions (but also tried on latest snapshots available):
Atmosphere 0.9.1, Nettosphere 1.3.1, AHC 1.7.4

EDIT: updated to Atmosphere 0.9.5, Nettosphere 1.4.0 and AHC 1.7.5 versions, the issue is still there

@jfarcand
Copy link
Member

jfarcand commented Jun 1, 2012

Looks like I did get the RSS feed for this project, so looking now.

@ncolomer
Copy link
Author

ncolomer commented Jun 1, 2012

Thanks, I was waiting for your feedbacks about this issue!
Don't hesitate to run the tests of the MapPush project : the failing one is testWebSocketBroadcastMessageWithBoundsChange()
Take care to enable it before launching TestNG, It was disabled to pass tests to green... (yes, the right way to do TDD!)

@ncolomer
Copy link
Author

This issue seems to have been fixed in recent Atmosphere/Nettosphere releases.
I just updated project's dependencies version to the following:

  • Jersey 1.12
  • Atmosphere 1.0.0
  • Nettosphere 1.4.2
  • AHC 1.7.6
  • Jetty 8.1.7.v20120910

And all my unit tests finally passed to green :)

However, I still have the following two log lines when sending a message from client to server through WebSocket:

17:10:39.090 [New I/O  worker #17] DEBUG o.a.nettosphere.NettyWebSocket - The WebSocket handshake succeeded but the dispatched URI failed Bad Request:400. The WebSocket connection is still open and client can continue sending messages.
17:10:39.091 [New I/O  worker #17] WARN  o.a.w.protocol.SimpleHttpProtocol - Status code higher or equal than 400 Status 400 Message Bad Request

This append both in unit tests (Nettosphere) and while running on Jetty. I these logs are not related to this issue, but I'm curious about the reason of this the dispatched URI failed Bad Request:400 (the second line is probably a consequence of the first one).

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants