users@glassfish.java.net

Helloworld Comet problem

From: <glassfish_at_javadesktop.org>
Date: Sat, 14 Feb 2009 07:23:28 PST

I am trying to make "helloworld" Comet example to
work. The index.html file of this looks like
following:

<html>
    <head>
        <script type="text/javascript" src="js/dojo/dojo.js"
                djConfig="parseOnLoad: true"></script>
        <script type="text/javascript">
            dojo.require("dojox.cometd");
            dojox.cometd.init("cometd");
            dojox.cometd.subscribe("/hello/world", myObject, "publishHandler");

            var myObject = {
                publishHandler: function(msg) {
                    alert(msg.data.test);
                }
            }
        </script>
    </head>
    <body>
        <input type="button"
               onclick="dojox.cometd.publish('/hello/world', { test: 'hello world' } )" value="Click Me!">
    </body>
</html>

It connects to the cometd of GlassFish v3 and /meta/handshakes has been
successful. Then it just kept performing /meta/connect indefinitely
for indefinite number of id's, all of them were successful.
I have the NetBeans project you can try as following

 http://www.javapassion.com/tmp/comethelloworld.zip

I have Slideshow sample application that is working and the
above has the exact same configuration. You can get the
NetBeans project from below

 http://www.javapassion.com/tmp/cometSlideshow.zip

Any help is appreciated. Thanks.

-Sang Shin
[Message sent by forum member 'sangshin' (sangshin)]

http://forums.java.net/jive/thread.jspa?messageID=331910