zk 6.5.3 & session serialization: didActivate invoked many times

asked 2015-04-08 11:24:24 +0800

cvarona gravatar image cvarona
554 1 6


I have quite a few zul forms powered by generic forward composers. I've been trying to make these forms fully serializable in order to achieve high availability. Quite to my surprise every composer's didActivate method gets invoked not just once, but many times. Exactly one for every listener defined as public void onXXX$... in the controller. By debugging I've seen that, within this piece of AbstractComponent's code:

if (_auxinf != null && _auxinf.listeners != null)
            for (Iterator<List<EventListenerInfo>> it = CollectionsX.comodifiableIterator(_auxinf.listeners.values());
                for (EventListenerInfo li: it.next())

every li.listener amounts to the controller instance itself.

I can of course very easily keep track of whether a certain didActivate invokation must be paid heed to by establishing a counter to be incremented in didPassivate and decremented in didActivate but, all the same, is it a bug or is it done on purpose (and in this case, which one)?


delete flag offensive retag edit


sounds like a bug, in that case without a specific reason. In general listeners can be scattered among various objects, it should be sufficient to activate /passivate the listeners only once. Which ZK version are you using? then I can do some additional tests, and comparing it to the latest version.

cor3000 ( 2015-04-09 07:32:46 +0800 )edit

6.5.3, as stated. I think I'll end up updating to zk7, but for the time being this is the version I must use. No idea if the same problem arises with versions > 6.5.3.

cvarona ( 2015-04-09 08:26:57 +0800 )edit

sorry didn't look in the title :P

cor3000 ( 2015-04-09 09:51:32 +0800 )edit

for clarification I raised the issue http://tracker.zkoss.org/browse/ZK-2701

cor3000 ( 2015-04-10 09:02:29 +0800 )edit

Very nice, thanks a lot for sparing time to check out this

cvarona ( 2015-04-10 09:51:41 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-05 00:42:46 +0800

cor3000 gravatar image cor3000
4406 2 7
ZK Team

updated 2015-09-01 07:40:25 +0800

http://tracker.zkoss.org/browse/ZK-2701 has been fixed for 7.0.6, FL version available for testing here http://www.zkoss.org/download/freshly/ (or maven version 7.0.6.FL.20150804-Eval)

update: have been released in the mean time, containing the fix as well http://www.zkoss.org/download/zk?ee

link publish delete flag offensive 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




Asked: 2015-04-08 11:24:24 +0800

Seen: 52 times

Last updated: Sep 01 '15

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