0

Publish an event queue throws an exception

asked 2012-07-05 16:38:13 +0800

Neus gravatar image Neus
1415 14

Hi,
I'm publishing an event queue this way:

EventQueues.lookup("notifica", EventQueues.APPLICATION, true).publish(new Event("onNotifica",null, notificacion));

It works correctly mostly all time but sometimes this exception is thrown:

GRAVE: >>org.zkoss.zk.ui.DesktopUnavailableException: Stopped
>>	at org.zkoss.zk.ui.impl.DesktopImpl.checkSeverPush(DesktopImpl.java:1420)
>>	at org.zkoss.zk.ui.impl.DesktopImpl.scheduleServerPush(DesktopImpl.java:1398)
>>	at org.zkoss.zk.ui.Executions.schedule(Executions.java:873)
>>	at org.zkoss.zk.ui.event.impl.ServerPushEventQueue$DesktopInfo.publish(ServerPushEventQueue.java:157)
>>	at org.zkoss.zk.ui.event.impl.ServerPushEventQueue$DesktopInfo.access$000(ServerPushEventQueue.java:137)
>>	at org.zkoss.zk.ui.event.impl.ServerPushEventQueue.publish(ServerPushEventQueue.java:53)
>>	at org.sts.generales.Herramientas.FuncionesComponentes.enviarNotificacion(FuncionesComponentes.java:535)
>>	at org.sts.Pyme.PantallasZul.IncidenciasyTareas.SeguimientoIncidencias.MaestroTareas.EnviarNotificacion(MaestroTareas.java:7809)
>>	at org.sts.Pyme.PantallasZul.IncidenciasyTareas.SeguimientoIncidencias.MaestroTareas.onClick$BTPublicarNotificar(MaestroTareas.java:7750)
>>	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>	at java.lang.reflect.Method.invoke(Method.java:597)
>>	at org.zkoss.zk.ui.event.GenericEventListener.onEvent(GenericEventListener.java:88)
>>	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2736)
>>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2707)
>>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2648)
>>	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
>>	at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:534)
>>	at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.sendEvent(EventProcessingThreadImpl.java:126)
>>	at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:321)
>>	at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:331)
>>	at org.zkoss.zk.ui.AbstractComponent$ForwardListener.onEvent(AbstractComponent.java:3174)
>>	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2736)
>>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2707)
>>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2648)
>>	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
>>	at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:534)
>>	at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:461)

What does it mean??

Thank you!

delete flag offensive retag edit

8 Replies

Sort by ยป oldest newest

answered 2012-07-05 16:44:54 +0800

zippy gravatar image zippy
504 1 2

updated 2012-07-05 16:46:17 +0800

look like you forgot enable serverpush

Try in doAfterCompose()

desktop.enableServerPush(true); 

link publish delete flag offensive edit

answered 2012-07-06 00:43:13 +0800

samchuang gravatar image samchuang
4084 4

is't possible to provide a War file with source code that can reproduce this issue ?

link publish delete flag offensive edit

answered 2012-07-06 06:33:39 +0800

Neus gravatar image Neus
1415 14

I will try to reproduce it but it's difficult because I don't know why it happens.
BTW, I never enable serverpush. I followed the ZK chat example to see how to send application events using EventQueue and I didn't see this line: desktop.enableServerPush(true); . Also, if this line is so important, it would fail always, right?

Thank you

link publish delete flag offensive edit

answered 2012-07-06 08:15:45 +0800

samchuang gravatar image samchuang
4084 4

updated 2012-07-06 08:16:15 +0800

hi, yes, when you use "application scope", zk will use server push automatically.

From the exception, it seems zk cannot get desktop (zk need desktop to update UI), it looks like connection is closed ? that's my wild guess.

link publish delete flag offensive edit

answered 2012-07-06 12:54:05 +0800

Neus gravatar image Neus
1415 14

updated 2012-07-06 12:55:16 +0800

What connection maybe is closed?
It's something strange because the actions in the event are executed but the exception is thrown and application flow breaks.

link publish delete flag offensive edit

answered 2012-07-06 14:28:54 +0800

zippy gravatar image zippy
504 1 2

ahhh i had the same error, a thread update the UI with timer. I do not know the reason because it happens,
I suspect the thread that performs the update (in my case)


I apply a patch solution:

if(desktop.isAlive)
     doSomething;

    

link publish delete flag offensive edit

answered 2012-07-06 14:29:42 +0800

zippy gravatar image zippy
504 1 2

if(!desktop.isAlive)
     stopThread();

link publish delete flag offensive edit

answered 2012-07-09 01:24:21 +0800

samchuang gravatar image samchuang
4084 4

the exception mentioned ZK cannot get desktop, one possibility is desktop is removed somehow, need a reproduce environment to locate issue

link publish delete flag offensive edit
Your reply
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: 2012-07-05 16:38:13 +0800

Seen: 225 times

Last updated: Jul 09 '12

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