Issue with JOptionPane

Stefan Lecho stlecho at gmail.com
Tue Oct 9 03:29:31 PDT 2012


Hi,

In a test scenario, there is a JOptionPane shown with contains a default
icon and an error message:

[image: Inline image 1]

The code to show this popup is the following one:
"JOptionPane.showMessageDialog(view,
errorMessage, getMessage(titleKey), messageType);"
When running this test scenario without Caciotta, the test runs correctly.
When running this test scenario wit Caciotta (v1.2), I'm getting a stack
trace (see underneath). I have the impression that the default icon is not
found by Caciotta.

I'll be glad if someone could help me with this issue.

java.lang.ClassCastException: sun.swing.SwingUtilities2$2 cannot be cast to
javax.swing.Icon
    at
javax.swing.plaf.basic.BasicOptionPaneUI.getIconForType(BasicOptionPaneUI.java:568)
~[na:1.7.0_02]
    at
javax.swing.plaf.basic.BasicOptionPaneUI.getIcon(BasicOptionPaneUI.java:542)
~[na:1.7.0_02]
    at
javax.swing.plaf.basic.BasicOptionPaneUI.createMessageArea(BasicOptionPaneUI.java:304)
~[na:1.7.0_02]
    at
javax.swing.plaf.basic.BasicOptionPaneUI.installComponents(BasicOptionPaneUI.java:172)
~[na:1.7.0_02]
    at
javax.swing.plaf.basic.BasicOptionPaneUI.installUI(BasicOptionPaneUI.java:141)
~[na:1.7.0_02]
    at javax.swing.JComponent.setUI(JComponent.java:664) [na:1.7.0_02]
    at javax.swing.JOptionPane.setUI(JOptionPane.java:1863) ~[na:1.7.0_02]
    at javax.swing.JOptionPane.updateUI(JOptionPane.java:1885)
~[na:1.7.0_02]
    at javax.swing.JOptionPane.<init>(JOptionPane.java:1848) ~[na:1.7.0_02]
    at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:859)
~[na:1.7.0_02]
    at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:668)
~[na:1.7.0_02]
    at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:639)
~[na:1.7.0_02]
    at
be.irisnet.kis.client.Controller.reportException(Controller.java:933)
~[KISClient-4.4.1-SNAPSHOT.jar:na]
    at
be.irisnet.kis.client.Controller.reportException(Controller.java:870)
~[KISClient-4.4.1-SNAPSHOT.jar:na]
    at be.irisnet.kis.client.Controller.processReply(Controller.java:754)
~[KISClient-4.4.1-SNAPSHOT.jar:na]
    at
be.irisnet.nova.client.common.logon.LogonController.processReply(LogonController.java:207)
~[Client-4.4.1-SNAPSHOT.jar:na]
    at be.irisnet.kis.client.Controller.sendRequest(Controller.java:984)
~[KISClient-4.4.1-SNAPSHOT.jar:na]
    at
be.irisnet.nova.client.common.logon.LogonController.okAction(LogonController.java:187)
~[Client-4.4.1-SNAPSHOT.jar:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[na:1.7.0_02]
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
~[na:1.7.0_02]
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0_02]
    at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_02]
    at
be.irisnet.kis.client.adapters.ActionComponentAdapter.invokeAction(ActionComponentAdapter.java:123)
[KISClient-4.4.1-SNAPSHOT.jar:na]
    at
be.irisnet.kis.client.adapters.ActionComponentAdapter.actionPerformed(ActionComponentAdapter.java:30)
[KISClient-4.4.1-SNAPSHOT.jar:na]
    at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
[na:1.7.0_02]
    at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
[na:1.7.0_02]
    at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
[na:1.7.0_02]
    at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
[na:1.7.0_02]
    at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
[na:1.7.0_02]
    at java.awt.Component.processMouseEvent(Component.java:6505)
[na:1.7.0_02]
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
[na:1.7.0_02]
    at java.awt.Component.processEvent(Component.java:6270) [na:1.7.0_02]
    at java.awt.Container.processEvent(Container.java:2229) [na:1.7.0_02]
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
[na:1.7.0_02]
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
[na:1.7.0_02]
    at java.awt.Component.dispatchEvent(Component.java:4687) [na:1.7.0_02]
    at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
[na:1.7.0_02]
    at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
[na:1.7.0_02]
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
[na:1.7.0_02]
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
[na:1.7.0_02]
    at java.awt.Window.dispatchEventImpl(Window.java:2713) [na:1.7.0_02]
    at java.awt.Component.dispatchEvent(Component.java:4687) [na:1.7.0_02]
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
[na:1.7.0_02]
    at java.awt.EventQueue.access$000(EventQueue.java:101) [na:1.7.0_02]
    at java.awt.EventQueue$3.run(EventQueue.java:666) [na:1.7.0_02]
    at java.awt.EventQueue$3.run(EventQueue.java:664) [na:1.7.0_02]
    at java.security.AccessController.doPrivileged(Native Method)
[na:1.7.0_02]
    at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
[na:1.7.0_02]
    at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
[na:1.7.0_02]
    at java.awt.EventQueue$4.run(EventQueue.java:680) [na:1.7.0_02]
    at java.awt.EventQueue$4.run(EventQueue.java:678) [na:1.7.0_02]
    at java.security.AccessController.doPrivileged(Native Method)
[na:1.7.0_02]
    at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
[na:1.7.0_02]
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:677) [na:1.7.0_02]
    at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
[na:1.7.0_02]
    at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
[na:1.7.0_02]
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
[na:1.7.0_02]
    at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
[na:1.7.0_02]
    at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
[na:1.7.0_02]
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
[na:1.7.0_02]


Regards, Stefan Lecho.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/caciocavallo-dev/attachments/20121009/5c1d0f47/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 18320 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/caciocavallo-dev/attachments/20121009/5c1d0f47/attachment.png 


More information about the caciocavallo-dev mailing list