0

Lots of requests with the same desktop id

asked 2013-12-31 15:45:03 +0800

cvarona gravatar image cvarona
554 1 6

updated 2013-12-31 15:48:09 +0800

Hi,

I'm having trouble with an application using polling server push. Everything works fine most of the time, but suddenly a burst of errors prevent the server push from working, only to recover some time later. This is what I get:

java.lang.IllegalStateException

Before calling Executions.schedule(), the server push must be enabled for [Desktop z_8x1:/index.zul]

at org.zkoss.zk.ui.impl.DesktopImpl.checkSeverPush(DesktopImpl.java:1431) ~[zk-6.5.3.jar:6.5.3]

at org.zkoss.zk.ui.impl.DesktopImpl.scheduleServerPush(DesktopImpl.java:1411) ~[zk-6.5.3.jar:6.5.3]

at org.zkoss.zk.ui.Executions.schedule(Executions.java:873) ~[zk-6.5.3.jar:6.5.3]

at org.zkoss.zk.ui.event.impl.ServerPushEventQueue$DesktopInfo.publish(ServerPushEventQueue.java:157) ~[zk-6.5.3.jar:6.5.3]

at org.zkoss.zk.ui.event.impl.ServerPushEventQueue$DesktopInfo.access$000(ServerPushEventQueue.java:137) ~[zk-6.5.3.jar:6.5.3]

at org.zkoss.zk.ui.event.impl.ServerPushEventQueue.publish(ServerPushEventQueue.java:53) ~[zk-6.5.3.jar:6.5.3]

Thread Thread-5564 (id=5892)

Timestamp 2013-12-31 10:54:52.981+0100

Username Marta.Lopez

--------------------------------------------------------------------------------
java.lang.IllegalStateException

Before calling Executions.schedule(), the server push must be enabled for [Desktop z_8x1:/index.zul]

at org.zkoss.zk.ui.impl.DesktopImpl.checkSeverPush(DesktopImpl.java:1431) ~[zk-6.5.3.jar:6.5.3]

at org.zkoss.zk.ui.impl.DesktopImpl.scheduleServerPush(DesktopImpl.java:1411) ~[zk-6.5.3.jar:6.5.3]

at org.zkoss.zk.ui.Executions.schedule(Executions.java:873) ~[zk-6.5.3.jar:6.5.3]

at org.zkoss.zk.ui.event.impl.ServerPushEventQueue$DesktopInfo.publish(ServerPushEventQueue.java:157) ~[zk-6.5.3.jar:6.5.3]

at org.zkoss.zk.ui.event.impl.ServerPushEventQueue$DesktopInfo.access$000(ServerPushEventQueue.java:137) ~[zk-6.5.3.jar:6.5.3]

at org.zkoss.zk.ui.event.impl.ServerPushEventQueue.publish(ServerPushEventQueue.java:53) ~[zk-6.5.3.jar:6.5.3]

at org.hidden.hidden.commands.EventQueueFinDevCommand.toStage(EventQueueFinDevCommand.java:362) ~[hiddenrt-2.7.0.jar:na]

at org.hidden.hidden.commands.Print.jamFreePrinting(Print.java:320) ~[hiddenrt-2.7.0.jar:na]

at org.hidden.hidden.commands.Print$2.onEvent(Print.java:170) ~[hiddenrt-2.7.0.jar:na]

at org.zkoss.zk.ui.event.impl.DesktopEventQueue$AsyncListenerThread.run(DesktopEventQueue.java:201) [zk-6.5.3.jar:6.5.3]

Thread Thread-5552 (id=5880)

Timestamp 2013-12-31 10:54:53.645+0100

Username Begona.Casas

It's only two out of many similar log messages separated by equally ludicrous lapses of time. That lots of requests by many different users share the same desktop id strikes me at most, specially if we take into account that no desktop recycling scheme has been implemented.

Has anybody experienced something like this before? Any clue as to what might be happening would be highly appreciated. I'm using zk 6.5.3 (as you can tell from the log traces) and there is a balancer between the users and the application.

Regards

delete flag offensive retag edit

Comments

Hi, can you post the code that reproduce the issue? From the log, it looks like you did not execute desktop.enableServerPush(true).

vincentjian ( 2014-01-02 08:35:18 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-01-02 09:43:50 +0800

cvarona gravatar image cvarona
554 1 6

updated 2014-01-02 10:02:23 +0800

Hi Vincent,

I'm writing this as an answer to my own question because 250 characters won't suffice.

You have a point that zk complains about the server push not being enabled. It has been, however, enabled before, because the exception is raised in a callback listener and not always as a response to the first event posted to the queue. I'm using an application scope queue which, according to the apidocs, automatically enables the server push. I'm doing it manually anyway, because I need to use my own implementation; this is what I do prior to subscribing:

Desktop desktop = Executions.getCurrent().getDesktop();
if( !desktop.isServerPushEnabled() ) {
    ( ( DesktopImpl ) desktop ).enableServerPush( [my implementation] );
}

_eventQueue.subscribe( _asynch, _callback );

[I would like to know, by the way, how can I unsubscribe from an event queue and at the same time disable the server push; by now I'm forced to include a one-time only timer that performs the disabling, because if a try to do it in the callback listener I get an exception]

I think the key to the resolution of this problem lies on those thousands of request displaying the same desktop id although they're submitted by different users which should be using desktops with different ids. How can it be possible? Do you think there is any possibility that the balancer is messing it all up?

Regards

link publish delete flag offensive edit

Comments

Hi, server push should be enabled by default if using EventQueue. It's hard to address the issue why it is using the same desktop. Maybe something wrong with _asynch and _callback.

vincentjian ( 2014-01-02 10:19:15 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2013-12-31 15:45:03 +0800

Seen: 20 times

Last updated: Jan 02 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More