Configure GlassFish v3.0.1 for Comet Support
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.
Enabling Comet Support in Web Admin Console
- Start GlassFish Server, navigate to Web Admin Console (default: http://localhost:4848/) in browser.
- At "Common Task" pan on left hand side, select "Configuration" –> "Network Config" –> "Network Listeners" –> "http-listener-1"
- At "Edit Network Listener", select tab "HTTP".
- Under tab "HTTP", select the checkbox of "Comet Support"
- Click "Save" button (at top of frame)