users@grizzly.java.net

Re: Fwd: Cant Establish WebSockets Connection on Glassfish 3.1.2

From: Ryan Lubke <ryan.lubke_at_oracle.com>
Date: Mon, 02 Apr 2012 07:57:15 -0700

Response posted to stackoverflow....

It appears you haven't enabled websocket support (disabled by default).

Issue the following command and then restart the server:

    asadmin set
    configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.websockets-support-enabled=true

You can replace http-listener-1 with whatever http-listener you wish to
enable WS support for.



On 4/2/12 6:29 AM, Oleksiy Stashok wrote:
> forwarding to users mailing list...
>
> -------- Original Message --------
> Subject: Cant Establish WebSockets Connection on Glassfish 3.1.2
> Date: Sun, 1 Apr 2012 13:27:08 +0000 (GMT)
> From: <bdicasa_at_gmail.com>
> Reply-To: issues_at_grizzly.java.net
> To: issues_at_grizzly.java.net
>
>
>
> Hello,
>
> I'm trying to get WebSockets working on Glassfish 3.1.2. I've posted
> the question on StackOverFlow at this url:
>
> http://stackoverflow.com/questions/9964716/grizzly-glassfish-cant-estab
> lish-websockets-handshake
>
> Any help is greatly appreciated. The question from StackOverFlow is
> below.
>
> I'm trying to get WebSockets working on top of Grizzly / Glassfish.
> I've cloned the sample WebSockets chat application, built it and
> deployed it to Glassfish 3.1.2. However, I cannot get WebSockets to
> connect. The WebSockets handshake is failing because I'm getting a 405
> (Method Not Allowed) response. This makes sense because of what is in
> the Servlet:
>
> public class WebSocketsServlet extends HttpServlet {
>
> private final ChatApplication app = new ChatApplication();
>
> @Override
> public void init(ServletConfig config) throws ServletException {
> WebSocketEngine.getEngine().register(app);
> }
>
> @Override
> public void destroy() {
> WebSocketEngine.getEngine().unregister(app);
> }
> }
> There is no doGet method specified, so I'm wondering if there is more
> configuration required somewhere, or if you need to implement the
> handshake logic in the servlet doGet method yourself?