users@glassfish.java.net

Re: Websocket connection not establishing in glasshfish server. How to fix it?

From: Noah White <emailnbw_at_gmail.com>
Date: Sat, 18 Feb 2012 18:43:44 -0500

GF 3.1.2 RC5 is out [1] . Is there any reason not to try that one instead?

-Noah

[1] - https://blogs.oracle.com/theaquarium/entry/final_rc_5_for_glassfish

On Feb 18, 2012, at 1:56 PM, Ryan Lubke wrote:

> The WebSocket support in 3.1.1 is dated. Please try your example with the latest 3.1.2 RC (download link available on glassfish.java.net).
>
>
> On 2/18/12 4:10 AM, forums_at_java.net wrote:
>>
>>
>> Hi i am trying *glassfish server(3.1.1)* websocket chatting example with
>> *grizzly(1.9.36)* framework.
>>
>> I have enabled the web socket support to glassfish with this executing this
>> command
>>
>> *" asadmin set
>> configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.websockets-support-enabled=true
>> "*
>>
>> I used this code
>> *http://antwerkz.com/glassfish-web-sockets-sample/?replytocom=105#respond*
>> site for imlement websocket example with glassfish and grizzly.
>>
>> now issue is that my *websocket connection is not eastablish with glassfish
>> server.*
>>
>> My browser has enabled the web socket support. Mozilla browser gives this
>> error
>>
>> *" Firefox can't establish a connection to the server at
>> ws://localhost:8081/nomavenws/chat. var connection = new
>> WebSocket('ws://localhost:8081/nomavenws/chat'); "*
>>
>> and sometimes i getgalssfih server side this error
>>
>> " SEVERE: Null keys are not allowed.
>> com.sun.grizzly.websockets.HandshakeException: Null keys are not allowed. at
>> com.sun.grizzly.websockets.SecKey.(SecKey.java:79) at
>> com.sun.grizzly.websockets.ServerHandShake.(ServerHandShake.java:68) at
>> com.sun.grizzly.websockets.ServerNetworkHandler.handshake(ServerNetworkHandler.java:95)
>> at
>> com.sun.grizzly.websockets.WebSocketEngine.upgrade(WebSocketEngine.java:136)
>> at
>> com.sun.grizzly.websockets.WebSocketAsyncFilter.doFilter(WebSocketAsyncFilter.java:52)
>> at
>> com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:171)
>> at
>> com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:143)
>> at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:94)
>> at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193) at
>> com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175) at
>> com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145)
>> at
>> com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:204)
>> at
>> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
>> at
>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
>> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
>> at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
>> at
>> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
>> at
>> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
>> at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at
>> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
>> at
>> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
>> at java.lang.Thread.run(Thread.java:679) "
>>
>> I am new developer in java. I have googled so much for fix this issue but
>> i am unable to fix this :(
>>
>> If someone knows how to fix this websocket connection issue? please help
>> me.
>>
>>
>>
>> I have attached the my source code contaning used .jar file.
>>
>>
>>
>>
>> --
>>
>> [Message sent by forum member 'abhijitaitwade']
>>
>> View Post: http://forums.java.net/node/883623
>>
>>
>