0

NullPointerException with Messagebox on ZK 6

asked 2012-01-27 08:09:27 +0800

Neus gravatar image Neus
1415 14

Hi,
I'm getting a NullPointerException when closing a messagebox with the X exit button (not using any buttons of the messagebox).

This is the stacktrace:

27-ene-2012 9:04:00 org.zkoss.zk.ui.impl.UiEngineImpl handleError:1345
GRAVE: >>java.lang.NullPointerException
>>	at org.zkoss.zul.Messagebox.show(Messagebox.java:417)
>>	at org.zkoss.zul.Messagebox.show(Messagebox.java:304)
>>	at org.sts.generales.Herramientas.MostrarMensaje.MostrarMensajeModal(MostrarMensaje.java:60)
>>	at org.sts.Pyme.PantallasZul.recursos.Componentes.MenuPyme.onClick$GesAppWeb(MenuPyme.java:307)
>>	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.zk.ui.event.GenericEventListener.onEvent(GenericEventListener.java:82)
>>	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2739)
>>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2710)
>>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2651)
>>	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:3177)
>>	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2739)
>>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2710)
>>	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2651)
>>	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)

delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2012-02-01 00:45:54 +0800

samchuang gravatar image samchuang
4084 4

Hi

could you post same code at zk fiddle

link publish delete flag offensive edit

answered 2012-02-01 08:22:21 +0800

Neus gravatar image Neus
1415 14

I can't reproduce it in ZK Fiddle. Maybe they don't have in zk.xml <disable-event-thread> set to false?
I write this code:
zul:

<zk>
<window title="new page title" border="normal" apply="PruebasViewCtrl.PruebaMessageboxViewCtrl">
	<button id="BTNMsgBox" label="Muestra messagebox"/>
</window>
</zk>

composer:

public class PruebaMessageboxViewCtrl extends SelectorComposer<Component> {
	private static final long serialVersionUID = 1L;

	@Override
	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);
		// TODO Auto-generated method stub

	}
	// Collects all the buttons whose label is "Clear", and adds EventListeners for them
	@Listen("onClick = button#BTNMsgBox")
	public void onMostrarMessageBox(MouseEvent event) {
		int iRespuesta;
		iRespuesta = Messagebox.show("Contenido" + "\n\n", "Titulo",Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
		System.out.println("Respuesta-> " + iRespuesta);
	}
}

I made a new project and try it. At first no exception appears. But then I realize that I didn't configure zk.xml to enable threads. I did it (<disable-event-thread> set to false), tried again the code and the exception appears.

link publish delete flag offensive edit

answered 2012-02-02 01:31:00 +0800

samchuang gravatar image samchuang
4084 4

updated 2012-02-02 01:31:21 +0800

Hi

I tried ZK 6.0.0-RC2 EE Evaluation version, with your code and set disable-event-thread false , i didn't get NPE, it works

which ZK 6 version do you use ?

link publish delete flag offensive edit

answered 2012-03-12 17:19:10 +0800

Neus gravatar image Neus
1415 14

Hi,
The exception is still thrown and I can't find any solution...
I'm using ZK 6.
Does anyone have any idea????
Thank you!

link publish delete flag offensive edit

answered 2012-03-12 17:20:21 +0800

Neus gravatar image Neus
1415 14

Notice that you have to close the messagebox using the X not a button

link publish delete flag offensive edit

answered 2012-03-16 01:34:48 +0800

samchuang gravatar image samchuang
4084 4

updated 2012-03-16 01:36:01 +0800

Hi

I follow your code and I can re-produce NPE, please post this bug here

Tested on ZK 6.0.1.FL.20120314 version
with
<zk>
<system-config>
<disable-event-thread>false</disable-event-thread>
</system-config>
</zk>

link publish delete flag offensive edit

answered 2012-03-16 07:27:07 +0800

Neus gravatar image Neus
1415 14

Thank you.
I just reported it.

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

RSS

Stats

Asked: 2012-01-27 08:09:27 +0800

Seen: 626 times

Last updated: Mar 16 '12

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