Configure GlassFish v3.0.1 for Comet Support

 
PHP Freelancer

Overview

First I must admit that I’m new to Comet/Server Push technology and GlassFish Server. That’s why I would like to try it out.

The fist thing I want to try is to deploy a sample Comet app posted on GlassFish v3 Application Development Guide. It turns out to be a bit harder than just uploading a war file to the server. The critical part is to enabling Comet support on GlassFish. In the development guide, a command

asadmin set server-config.network-config.protocols.protocol.http-1.http.comet-support-enabled="true"

is given to enable Comet support on the HTTP listener “http-1”. However I cannot run this command succesfully, so in this post I will enable Comet support by using Web Admin Console.

Reference

  1. GlassFish v3 Application Development Guide – Grizzly Comet

Steps

Enabling Comet Support in Web Admin Console

  1. Start GlassFish Server, navigate to Web Admin Console (default: http://localhost:4848/) in browser.
  2. At "Common Task" pan on left hand side, select "Configuration" –> "Network Config" –> "Network Listeners" –> "http-listener-1"
  3. At "Edit Network Listener", select tab "HTTP".
  4. Under tab "HTTP", select the checkbox of "Comet Support"
  5. Click "Save" button (at top of frame)
  6. Done!
 

Discussion

What do you think? Leave a comment. Alternatively, write a post on your own weblog; this blog accepts trackbacks [trackback url].

Comments
1.
On July 17th, 2010 at 6:38 am, Gerry Jenkins said:

I had the same problem with the command:

asadmin set server-config.network-config.protocols.protocol.http-1.http.comet-support-enabled=”true”

I found that in the v3 documentation after it listed that command it said to substitue the actual name of the protocol for http-1, the real name of the protocol is http-listener-1
so the correct command is:
asadmin set server-config.network-config.protocols.protocol.http-listener-1.http.cometenabled=”true”

2.
On July 19th, 2010 at 11:30 pm, arieslee said:

Oh I see~
Thx for pointing it out! ;-D

3.
On September 25th, 2010 at 1:07 am, Wordpress Themes said:

Nice fill someone in on and this post helped me alot in my college assignement. Say thank you you for your information.

Leave a Reply