ClassCastexception

Roman Kennke roman at kennke.org
Fri Jan 4 02:41:13 PST 2013


Hi Jeroen,

Thanks for reporting the issue. I will look into it as soon as I can. I
filed a bug report:

http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1247

Best regards,
Roman

> 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. 




More information about the caciocavallo-dev mailing list