Running the tutorials

47 views
Skip to first unread message

Andy

unread,
Nov 25, 2010, 12:49:25 AM11/25/10
to StreamHub Comet Server Community
Hi all,

I got StreamHub working fine with the examples that came within the
same download package, but I have tried following two tutorials, one
for the HelloWorld and the other for the Chat application from the
StreamHub pages in Blogspot. They compile with no problems, but when
I click on the buttons in the web browser to send the message nothing
happens in either of the samples.

I have compiled and ran these two examples from two different
computers, and I get the same thing: I get to see the page, but
clicking on the button doesn't appear to do anything. I tried with
IE, Firefox and Chrome in both computers.

One of the computers is a Windows Vista 32 bit, the other one is a
Windows 7 64 bit. Both have JDK 1.6.0.22, and I'm using
json-20080701.jar, log4j-1.2.14.jar and streamhub-2.2.7.jar

Any suggestions?
Thanks!
Andy

StreamHub Team

unread,
Nov 25, 2010, 3:15:50 PM11/25/10
to StreamHub Comet Server Community
Hi Andy,

The way you connect changed in 2.1 onwards, those demos refer to
2.0.x. To get the demo's working with 2.1+ all you need to do is
change the connect statements from:

hub.connect("http://localhost:7878/");

..to:

hub.connect("http://localhost:7878/streamhub/");

That should get them working. For more details on why this changed
see:

http://streamhub.blogspot.com/2010/04/streamhub-2112-beta-release-server.html


If you hit any more snags let us know.

Happy coding!
The StreamHub Team

Andy

unread,
Nov 25, 2010, 11:41:51 PM11/25/10
to StreamHub Comet Server Community
Thank you guys!

Using
did the trick. Perhaps you could update that line of code in your
sample page? Especially since it seems it's no longer possible to
download the older versions of StreamHub.

I have some more questions and comments regarding the samples you
present on your web page http://streamhub.blogspot.com/2009/10/getting-started-with-reverse-ajax-and.html

1. The Java code for the stock ticker sample, on line 16 originally
says:

private final Set symbols = new HashSet();

but it doesn't compile with my javac version 1.6.0.22. In order
to make it compile it's necessary to change it to:

private final Set<String> symbols = new HashSet<String>();

2. I notice that sometimes the stock ticker sample doesn't start to
show the stock prices on the web browser right away and it's necessary
to refresh the page several times to get the numbers start to roll.
Is there anything I can do to fix this?

3. In the hello world sample, clicking on the "Say Hello" button
quickly doesn't seem to work, I need to wait one or two seconds
between clicks for it to really work. For my current needs that's
good enough, but would it be possible to make the wait between clicks
shorter? How?

Thanks guys! I think StreamHub works really neat!
Andy
Reply all
Reply to author
Forward
0 new messages