stebetko
stebetko

Reputation: 735

Invalid handshake response exception

I am doing stress test with our tomcat server that communicates with its clients through websocket technology. So when I try more then 150 concurrent users on client side I receive this exception and I don't know what server wants to say.

java.util.concurrent.ExecutionException: java.io.IOException: Invalid handshake response
    at com.ning.http.client.providers.netty.NettyResponseFuture.abort(NettyResponseFuture.java:297)
    at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.abort(NettyAsyncHttpProvider.java:1376)
    at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.access$800(NettyAsyncHttpProvider.java:137)
    at com.ning.http.client.providers.netty.NettyAsyncHttpProvider$WebSocketProtocol.handle(NettyAsyncHttpProvider.java:2400)
    at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.messageReceived(NettyAsyncHttpProvider.java:1178)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:75)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:792)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
    at org.jboss.netty.handler.codec.replay.ReplayingDecoder.unfoldAndFireMessageReceived(ReplayingDecoder.java:600)
    at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:584)
    at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:445)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:75)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:94)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:372)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:246)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:38)
    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:102)
    at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.IOException: Invalid handshake response
    ... 23 more

Let me know if you could help.

Thanks

Upvotes: 1

Views: 3895

Answers (3)

Rijuvana Shahul
Rijuvana Shahul

Reputation: 1

I also faced same issue, resolved by putting the chromedriver.exe file in some other location.it worked.

configure driver = {
    type: 'chromedriver',
    executable: 'C:\\driver\\chromedriver_win32\\chromedriver.exe'
}

Upvotes: 0

mahadevan gss
mahadevan gss

Reputation: 66

Most probable reason is you might not have client-side-URL without "websocket" like:

"ws://"+HOST+":"+ PORT+"/websocket"

If you miss /websocket in client side code while talking to server you will get this exception

Upvotes: 1

Hari
Hari

Reputation: 383

You have to follow the same rule that you followed on the browser client side

that is on your client side you might have added the below code

$atmosphere.subscribe(request);

the same you have to do on your java client also, Since your request are not subscribed to atmosphere,the atmosphere is not authenicate your request. On the java side first you to do atmosphere connect and then you have to fire your requests...

Upvotes: 0

Related Questions