strange error when showing a dialog

Hello,

recently (not sure if 2.2 only or before already) I have a strange problem when showing dialogs. I have a tab panel that shows all kinds of forms. Some of these my have more tab panels. In some of those there is a button that shows a dialog.

That dialog shows correctly (something like “Do you really want to delete this record?”), but in the background Servoy switches to design view. When I click OK in the dialog, I see the design view of the form, but I don’t seem to be in design view really. At least I have to click the design button twice to come back to browse mode.

One other time, I saw the spinning Servoy logo when showing the dialog. :?

Once, I found this in the log. But although I can demonstrate the above behaviour, I cannot produce this log entry again, so it might be some other error. So basically, everytime I show a dialog with the dialog plugin, I have this problem.

java.lang.NullPointerExceptionjava.lang.NullPointerException
at javax.swing.SwingUtilities.computeIntersection(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
at com.servoy.j2db.develop.debugger.k.handleBreakpointHit(Unknown Source)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2179)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
at com.servoy.j2db.develop.debugger.k.executeFunction(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.cr(Unknown Source)
at com.servoy.j2db.dataui.l.cY(Unknown Source)
at com.servoy.j2db.dataui.l.getComponentCount(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at java.awt.Component.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at java.awt.Window.addNotify(Unknown Source)
at java.awt.Dialog.addNotify(Unknown Source)
at java.awt.Window.pack(Unknown Source)
at javax.swing.JOptionPane.createDialog(Unknown Source)
at javax.swing.JOptionPane.showOptionDialog(Unknown Source)
at com.servoy.r2.plugins.dialog.DialogProvider.js_showDialogEx(DialogProvider.java:68)
at com.servoy.r2.plugins.dialog.DialogProvider.js_showErrorDialog(DialogProvider.java:37)
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.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:289)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1242)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1242)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
at com.servoy.j2db.develop.debugger.k.access$14(Unknown Source)
at com.servoy.j2db.develop.debugger.k$3.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.ArrayIndexOutOfBoundsException: No such child: 0java.lang.ArrayIndexOutOfBoundsException: No such child: 0
at java.awt.Container.getComponent(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JSplitPane.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
at com.servoy.j2db.develop.debugger.k.handleBreakpointHit(Unknown Source)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2179)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
at com.servoy.j2db.develop.debugger.k.executeFunction(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.cr(Unknown Source)
at com.servoy.j2db.dataui.l.cY(Unknown Source)
at com.servoy.j2db.dataui.l.getComponentCount(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at java.awt.Component.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at java.awt.Window.addNotify(Unknown Source)
at java.awt.Dialog.addNotify(Unknown Source)
at java.awt.Window.pack(Unknown Source)
at com.servoy.j2db.util.gui.g.a(Unknown Source)
at com.servoy.j2db.develop.J2DBDeveloper.reportDetailMessage(Unknown Source)
at com.servoy.j2db.develop.J2DBDeveloper.reportError(Unknown Source)
at com.servoy.j2db.develop.J2DBDeveloper.reportError(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.cr(Unknown Source)
at com.servoy.j2db.dataui.l.cY(Unknown Source)
at com.servoy.j2db.dataui.l.getComponentCount(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at java.awt.Component.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at java.awt.Window.addNotify(Unknown Source)
at java.awt.Dialog.addNotify(Unknown Source)
at java.awt.Window.pack(Unknown Source)
at javax.swing.JOptionPane.createDialog(Unknown Source)
at javax.swing.JOptionPane.showOptionDialog(Unknown Source)
at com.servoy.r2.plugins.dialog.DialogProvider.js_showDialogEx(DialogProvider.java:68)
at com.servoy.r2.plugins.dialog.DialogProvider.js_showErrorDialog(DialogProvider.java:37)
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.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:289)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1242)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1242)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
at com.servoy.j2db.develop.debugger.k.access$14(Unknown Source)
at com.servoy.j2db.develop.debugger.k$3.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Hmm. I thought this problem was gone. But I seem to still have that. And once the dialog is shown, I see this error in the log. Does this help narrow it down?

java.lang.IllegalArgumentException: Multiple decimal separators in pattern "EE dd.MM.yyyy HH:mm"java.lang.IllegalArgumentException: Multiple decimal separators in pattern “EE dd.MM.yyyy HH:mm”
at java.text.DecimalFormat.applyPattern(Unknown Source)
at java.text.DecimalFormat.(Unknown Source)
at com.servoy.j2db.dataui.x.(Unknown Source)
at com.servoy.j2db.dataui.DataField.setFormat(Unknown Source)
at com.servoy.j2db.dataui.k.a(Unknown Source)
at com.servoy.j2db.dataui.k.if(Unknown Source)
at com.servoy.j2db.dataui.k.a(Unknown Source)
at com.servoy.j2db.TableView.(Unknown Source)
at com.servoy.j2db.FormPanel.setView(Unknown Source)
at com.servoy.j2db.FormManager.a(Unknown Source)
at com.servoy.j2db.dataui.l.cY(Unknown Source)
at com.servoy.j2db.dataui.l.getComponentCount(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at sun.awt.windows.WPanelPeer.restack(Unknown Source)
at java.awt.Component.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at java.awt.Window.addNotify(Unknown Source)
at java.awt.Dialog.addNotify(Unknown Source)
at java.awt.Window.pack(Unknown Source)
at javax.swing.JOptionPane.createDialog(Unknown Source)
at javax.swing.JOptionPane.showOptionDialog(Unknown Source)
at com.servoy.r2.plugins.dialog.DialogProvider.js_showDialogEx(DialogProvider.java:68)
at com.servoy.r2.plugins.dialog.DialogProvider.js_showWarningDialog(DialogProvider.java:29)
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.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:289)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1242)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
at com.servoy.j2db.develop.debugger.k.access$14(Unknown Source)
at com.servoy.j2db.develop.debugger.k$3.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

but if i look to youre stacktrace i see one strange thing:

I see a DecimalFormatter with a Date format string

So somehow you have there a field of type Number/Integer but you have given it a dateformat..

That’s what I understood, too. But why do I get it if I show a warning dialog and why don’t I get it if I have no field formats on any fields on the screen?

I think I notice one thing: when the dialog shows up, all of a sudden all kind of onLoads are executed. Maybe in one of the forms that is loaded I have this problem. And since I end up in desgin mode, I have the impression that everything is loaded because there is a switch to design mode. But all kinds of methods are executed, which is strange, because usually in design mode no methods are executed.

:?

there is something really strange with youre java installation.

What os/java version are you using?

Servoy Developer
Version R2 2.2b1-build 316
Java version 1.5.0-b64 (Windows XP)

could you test for once with a 1.4.x installation?
I just saw in the 1.5 code that that restack is a new 1.5 feature…

Do you have a reproducable solution for me?

I tried to create a sample, but couldn’t make it happen. I can only send you something with 100 tables and so forth… I can test on 1.4.x on Monday, or maybe tomorrow.

I also see this behaviour (switching to design mode) when executing a global method that is attached to a global field in one of my forms. There is no dialog envolved. If, however, I make this method a form method, the problem does not occur.

I am not sure if this problem is new since 2.2. It is extremely annoying, anyway, because almost everywhere I click right now I either end up in design mode or see the spinning Servoy icon that usually shows up when loading a solution.

Is there any hope for a fix? I tried to make a sample that shows this behaviour, but it looks like it is also related to tab panels or lots of forms or ?? If it helps, I send the whole solution…

Thanks!
Patrick

please try with 1.4.x first.
We need to verify it is not a 1.5 bug somehow
(if this is the case i am still interested in youre solution because i hope somehow that i can send a bug report to sun)

hmm. That doesn’t sound good at all. I am even getting that problem now when for example calling the “about servoy” dialog… I hope it is not a Java bug, because we have good experiences with 1.5 especially regarding HTML (cell borders are visible now etc.). Anyway, this is quite a killer right now. I am not sure how long I have this, since I developed more than I tested recently.

If it helps: just tested on a Mac running Java 1.4.2-38. This problem does not occur there. Does that info help?

i have seen it yet and i use 1.5 for quite some time now.
You could try to update to the latest release: 1.5.0_01

but also the best thing to do do test it is to install a 1.4.2 installation besides 1.5.0 so you can see it on the same machine.

I did update to 1.5.0_01 - no change. What do you mean by “installation besides”? Deinstall Java and downgrade to 1.4?

no just install 1.4.2 besides 1.5
you can have more runtimes on youre system. Thats no problem

Just did that. It looks like this does not happen under Java 1.4.2_06-b03. So what do we do?

i am currently diving into the source of the jdk 1.5 classes.
Maybe i can see something there why it suddenly does calls to a panel that had nothing to do with the dialog you are showing.
I also will send a bug report to sun.

i think i could get around this behaviour of 1.5
please test it in the comming build, if all goes well it will be today

Huh!:lol: I am REALLY glad to hear that. You bet I’ll test that!

Thanks a lot!

Patrick

Johan,

thank you very much for your effort! This looks a lot better. I am not sure if it is 100% fixed because I saw some strange things happening. I will keep watching this but for the moment I am happy for your fix! :lol: