-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
this exception is thrown when the browser window is closed with a modal window in it:
07-nov-2012 17:51:42 org.zkoss.bind.impl.ParamCall call:115 GRAVE: org.zkoss.zk.ui.UiException: java.lang.InterruptedException: Destroy desktop [Desktop z_0ay:/Pruebas/PruebaVentana/PruebaAbrirModal.zul] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.zkoss.lang.Classes.newInstance(Classes.java:73) at org.zkoss.lang.Exceptions.wrap(Exceptions.java:161) at org.zkoss.zk.ui.UiException$Aide.wrap(UiException.java:44) at org.zkoss.zul.Window.enterModal(Window.java:616) at org.zkoss.zul.Window.doModal(Window.java:545) at org.sts.Pruebas.PruebaVentana.PruebaAbrirModal.abrirModal(PruebaAbrirModal.java:20) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.zkoss.bind.impl.ParamCall.call(ParamCall.java:109) at org.zkoss.bind.impl.BinderImpl.doExecute(BinderImpl.java:1508) at org.zkoss.bind.impl.BinderImpl.doCommand(BinderImpl.java:1261) at org.zkoss.bind.impl.BinderImpl.access$1500(BinderImpl.java:95) at org.zkoss.bind.impl.BinderImpl$CommandEventListener.onEvent0(BinderImpl.java:1145) at org.zkoss.bind.impl.BinderImpl$CommandEventListener.onEvent(BinderImpl.java:1103) at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2734) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2705) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2646) 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) Caused by: java.lang.InterruptedException: Destroy desktop [Desktop z_0ay:/Pruebas/PruebaVentana/PruebaAbrirModal.zul] at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.doSuspend0(EventProcessingThreadImpl.java:244) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.doSuspend(EventProcessingThreadImpl.java:190) at org.zkoss.zk.ui.impl.UiEngineImpl.wait(UiEngineImpl.java:1544) at org.zkoss.zk.ui.Executions.wait(Executions.java:703) at org.zkoss.zul.Window.enterModal(Window.java:614) ... 18 more 07-nov-2012 17:51:42 org.zkoss.bind.impl.BinderImpl$CommandEventListener onEvent:1105 GRAVE: java.lang.InterruptedException: Destroy desktop [Desktop z_0ay:/Pruebas/PruebaVentana/PruebaAbrirModal.zul] org.zkoss.zk.ui.UiException: java.lang.InterruptedException: Destroy desktop [Desktop z_0ay:/Pruebas/PruebaVentana/PruebaAbrirModal.zul] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.zkoss.lang.Classes.newInstance(Classes.java:73) at org.zkoss.lang.Exceptions.wrap(Exceptions.java:161) at org.zkoss.zk.ui.UiException$Aide.wrap(UiException.java:44) at org.zkoss.zul.Window.enterModal(Window.java:616) at org.zkoss.zul.Window.doModal(Window.java:545) at org.sts.Pruebas.PruebaVentana.PruebaAbrirModal.abrirModal(PruebaAbrirModal.java:20) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.zkoss.bind.impl.ParamCall.call(ParamCall.java:109) at org.zkoss.bind.impl.BinderImpl.doExecute(BinderImpl.java:1508) at org.zkoss.bind.impl.BinderImpl.doCommand(BinderImpl.java:1261) at org.zkoss.bind.impl.BinderImpl.access$1500(BinderImpl.java:95) at org.zkoss.bind.impl.BinderImpl$CommandEventListener.onEvent0(BinderImpl.java:1145) at org.zkoss.bind.impl.BinderImpl$CommandEventListener.onEvent(BinderImpl.java:1103) at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2734) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2705) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2646) 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) Caused by: java.lang.InterruptedException: Destroy desktop [Desktop z_0ay:/Pruebas/PruebaVentana/PruebaAbrirModal.zul] at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.doSuspend0(EventProcessingThreadImpl.java:244) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.doSuspend(EventProcessingThreadImpl.java:190) at org.zkoss.zk.ui.impl.UiEngineImpl.wait(UiEngineImpl.java:1544) at org.zkoss.zk.ui.Executions.wait(Executions.java:703) at org.zkoss.zul.Window.enterModal(Window.java:614) ... 18 more
Here it is a sample code to reproduce it:
PruebaAbrirModal.zul
<?page title="new page title" contentType="text/html;charset=UTF-8"?> <zk> <borderlayout apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('org.sts.Pruebas.PruebaVentana.PruebaAbrirModal')"> <north></north> <center> <div> <button id="btn" label="Open modal window" onClick="@command('abrirModal')"/> </div> </center> </borderlayout> </zk>
PruebaAbrirModal.java
import org.zkoss.bind.annotation.*; import org.zkoss.zk.ui.*; import org.zkoss.zk.ui.event.*; import org.zkoss.zul.*; public class PruebaAbrirModal { /** * */ private static final long serialVersionUID = 1L; private Window ventanaModal; @Command public void abrirModal(){ ventanaModal = (Window) Executions.createComponents("ventanaModal.zul", null, null); ventanaModal.setVisible(false); // Events.echoEvent("onMostrar", ventanaModal, null); ventanaModal.doModal(); } }
VentanaModal.zul
<?page title="new page title" contentType="text/html;charset=UTF-8"?> <zk> <window id="ventana" title="Hi" border="normal"> <label id="lbl" value="Hello!"/> </window> </zk>
You must open the modal window and close the browser page. It throws an interrupted exception.
Can it be solved?
Thank you!
Hi Neus,
Please read these reference: The disable-event-thread Element and Event Threads.
According to these reference, ZK don't suggest programmer set this setting false - if your system need to use Modal window.
Can you tell us why need to enable "disable-event-thread"?
Regards,
Monty Pan
Hi Neus,
Sorry, I can't reproduce your situation by sample code on ZK 6.5.
Can you check the code and provide detail information like ZK version (if not ZK 6.5), JDK version, Web server and so on?
Regards,
Monty Pan
Yes that code throws the exception...And I have some javascript actions in the onunload event and it seems that when this exception is thrown the actions are not executed.
I'm using ZK 6.03 with Tomcat 7. My java version is 1.6.0_35
Thank you for your answer
In these links you tell me says:
Enable the event thread if the project uses messagebox and modal windows a lot.
So, if I set disable-event-thread property to false, I'm enabling it as the references says, isn't it?
Hi Neus,
If you set the value "false", it means "don't disable event thread" equals "enable event thread".
> Enable the event thread only if the project does not need to integrate other frameworks (such as Spring), uses Messagebox and modal windows a lot, and does not have a lot of concurrent users.
So, the conclusion is: set the "disable-event-thread" value true
Regards,
Monty Pan
These sentences are separated by a comma so I understand that I must enable them if I don't integrate frameworks OR if I use Messagebox and modal windows.
I'm using messagebox and a lot of modal windows, that's why I enable them. Am I not understanding it well?? (I'm not an english speaker so maybe I'm misunderstood...)
Besides, If I disable them modal window doesn't stop the current thread, so execution continues and modal window function is useless! I made that test writing a System.out.println after calling doModal(). If threads are enabled the System.out.println is not called until the window is closed. If threads are disabled, the System is printed just after calling doModal()
Hi Neus,
I've replied this issue at another thread, please refer to http://www.zkoss.org/forum/listComment/21285
Regards,
Ben
Asked: 2012-11-07 17:03:22 +0800
Seen: 250 times
Last updated: Dec 12 '12