Luna release: casting problem [message #1237784] |
Thu, 30 January 2014 15:30 |
|
Hi,
I am working on project developed in Eclipse Helios, migrating from Eclipse 3.x to Eclipse 4 (in Luna release), one of problem is the following:
(java.lang.ClassCastException: org.eclipse.ui.internal.WorkbenchWindow cannot be cast to org.eclipse.jface.window.ApplicationWindow)
that is, the following casting:
...
((ApplicationWindow)PlatformUI.getWorkbench().getActiveWorkbenchWindow()).getShell()
...
arise the SWT exception:
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.ClassCastException: org.eclipse.ui.internal.WorkbenchWindow cannot be cast to org.eclipse.jface.window.ApplicationWindow).
Do you have a workaround or a solution for this problem.
Best regards,
pina
[Updated on: Thu, 30 January 2014 15:51] Report message to a moderator
|
|
|
|
Re: Luna release: casting problem [message #1238113 is a reply to message #1237785] |
Fri, 31 January 2014 12:28 |
|
Hi,
stack trace is:
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.ClassCastException: org.eclipse.ui.internal.WorkbenchWindow cannot be cast to org.eclipse.jface.window.ApplicationWindow)
at org.eclipse.swt.SWT.error(SWT.java:4419)
at org.eclipse.swt.SWT.error(SWT.java:4334)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:139)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4145)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1122)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1006)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:146)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:565)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at it.unisa.coffeediscusser.Application.start(Application.java:42)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226)
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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.lang.ClassCastException: org.eclipse.ui.internal.WorkbenchWindow cannot be cast to org.eclipse.jface.window.ApplicationWindow
at xx.xxx.xx.ApplicationWorkbenchWindowAdvisor.applyTheme(ApplicationWorkbenchWindowAdvisor.java:125)
at it.unisa.coffeediscusser.ApplicationWorkbenchWindowAdvisor.postWindowOpenActions(ApplicationWorkbenchWindowAdvisor.java:242)
at it.unisa.coffeediscusser.ApplicationWorkbenchWindowAdvisor.access$0(ApplicationWorkbenchWindowAdvisor.java:158)
at it.unisa.coffeediscusser.ApplicationWorkbenchWindowAdvisor$1.run(ApplicationWorkbenchWindowAdvisor.java:105)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
... 24 more
thanks,
Pina
[Updated on: Tue, 04 February 2014 21:47] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.25628 seconds