ClassCastexception

Jeroen Lanckmans Jeroen.Lanckmans at uzbrussel.be
Fri Jan 4 01:31:28 PST 2013


Hello,
I have some swing test that I'm running with caciocavallo.
These test are running perfect but in the logs I see the following error.

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: sun.awt.peer.cacio.ProxyWindow cannot be cast to be.azvub.util.TAzVubFrame
                at be.azvub.util.TAzVubFrame$WindowAdapter.windowOpened(TAzVubFrame.java:691)
                at java.awt.AWTEventMulticaster.windowOpened(AWTEventMulticaster.java:339)
                at java.awt.Window.processWindowEvent(Window.java:2048)
                at javax.swing.JFrame.processWindowEvent(JFrame.java:296)
                at java.awt.Window.processEvent(Window.java:2009)
                at java.awt.Component.dispatchEventImpl(Component.java:4861)
                at java.awt.Container.dispatchEventImpl(Container.java:2287)
                at java.awt.Window.dispatchEventImpl(Window.java:2719)
                at java.awt.Component.dispatchEvent(Component.java:4687)
                at sun.awt.peer.cacio.ProxyWindowPeer.handleEvent(ProxyWindowPeer.java:169)
                at java.awt.Component.dispatchEventImpl(Component.java:4937)
                at java.awt.Container.dispatchEventImpl(Container.java:2287)
                at java.awt.Window.dispatchEventImpl(Window.java:2719)
                at java.awt.Component.dispatchEvent(Component.java:4687)
                at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:713)
                at java.awt.EventQueue.access$000(EventQueue.java:104)
                at java.awt.EventQueue$3.run(EventQueue.java:672)
                at java.awt.EventQueue$3.run(EventQueue.java:670)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
                at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
                at java.awt.EventQueue$4.run(EventQueue.java:686)
                at java.awt.EventQueue$4.run(EventQueue.java:684)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
                at java.awt.EventQueue.dispatchEvent(EventQueue.java:683)
                at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
                at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
                at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
                at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
                at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
                at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

The exception occurs in a windowListener where the following code is executed.

public void windowOpened(WindowEvent we) {
         TAzVubFrame azvubframe = (TAzVubFrame) we.getWindow();
         Azvubframe.doSomething();
}

This has no effect on the test because afterwards the method is called again but now we.getWindow() returns the correct window.
The problem is that the window listener is in a package I can't edit. So I can't add a test before the cast.
Mvg,
Jeroen Lanckmans
[cid:image001.gif at 01CDEA62.718FDA80]
________________________________
Jeroen Lanckmans
Medische Informatieverwerking

jeroen.lanckmans at uzbrussel.be<mailto:jeroen.lanckmans at uzbrussel.be>

Laarbeeklaan 101 - 1090 Brussel
Tel 02 477 69 58
www.uzbrussel.be<http://www.uzbrussel.be/>
________________________________




De informatie in deze Internet-mail is vertrouwelijk en uitsluitend bedoeld voor de bestemmeling. Indien
u niet de bedoelde bestemmeling bent, dan is het openen, kopiëren en verspreiden ervan verboden.

P Please consider the environment before printing this email.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/caciocavallo-dev/attachments/20130104/8f699d49/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1716 bytes
Desc: image001.gif
Url : http://mail.openjdk.java.net/pipermail/caciocavallo-dev/attachments/20130104/8f699d49/image001.gif 


More information about the caciocavallo-dev mailing list