Tuesday, April 5, 2011

Wicket: wicket-ajax Channel busy postponing

I got above error when using Wicket + wiQuery + wicket-push(cometd). I struggled for a day and finally, solved it.

In my case, the issue appeared on Firefox, but not happened on Chrome. Also When the page was first loaded, it worked fine. However, after reload the page, it happened. Any wicket's ajax request was blocked. And in the Wicket-Ajax-Debug window, "INFO: Channel busy postponing" message appeared.

The problem is caused by, **I guess**, wicket-ajax.js + jquery. When some jquery javascript start earlier than something, it will harm wicket-ajax.js. In my case, by cometd javascript, (see this) $.cometd.configure() and $.cometd.handshake() starts without waiting loading whole contents in the page. So I fix as follows.

$(window).load(function(){
    $.cometd.configure();
    $.cometd.handshake();
});

This will delay the two functions to start. And problem was gone.

I'm not sure this is a right way to do. Please leave comment if you find the better solution for the same problem.

1 comment: