Phase Listener Error [message #647822] |
Sun, 09 January 2011 17:10 |
Sudesh Bulathsinhala Messages: 193 Registered: October 2010 |
Senior Member |
|
|
hello,
we're developing single-source product which supports both RCP and RAP.
when RAP entry-point is invoked, everything seemed to work as expected, except we get the following error message everytime when we open an editor or dialog.
(the editor opens correctly and all the widgets are placed properly and it's behavior is normal, except the error message)
ERROR
2011-01-09 08:58:09.189:WARN:/:ERROR: Could not execute PhaseListener after phase 'PROCESS_ACTION'.
java.lang.ClassCastException: org.eclipse.swt.layout.FormData cannot be cast to org.eclipse.swt.layout.FillData
at org.eclipse.swt.layout.FillLayout.flushCache(FillLayout.java :164)
at org.eclipse.swt.widgets.Composite.changed(Composite.java:603 )
at org.eclipse.swt.internal.graphics.TextSizeDeterminationHandl er$1.doVisit(TextSizeDeterminationHandler.java:86)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor$AllWidget TreeVisitor.visit(WidgetTreeVisitor.java:35)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi dgetTreeVisitor.java:49)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi dgetTreeVisitor.java:56)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi dgetTreeVisitor.java:56)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi dgetTreeVisitor.java:56)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi dgetTreeVisitor.java:56)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi dgetTreeVisitor.java:56)
at org.eclipse.swt.internal.graphics.TextSizeDeterminationHandl er.afterPhase(TextSizeDeterminationHandler.java:133)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.afterPhaseEx ecution(RWTLifeCycle.java:371)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.continueLife Cycle(RWTLifeCycle.java:208)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLif eCycle.java:295)
at org.eclipse.swt.widgets.Display.sleep(Display.java:1128)
at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(Wo rkbenchAdvisor.java:361)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2391)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2351)
at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:22 06)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:424)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.jface.internal.databinding.realmadapter.RealmAda pter.run(RealmAdapter.java:44)
at org.eclipse.rap.ui.internal.RealmAdapterHook.runWithDefault( RealmAdapterHook.java:48)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:427)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:157)
at com.argos.sys.client.entrypoint._rap.ClientEntryPoint.create UI(ClientEntryPoint.java:18)
at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:245)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:114)
at java.lang.Thread.run(Unknown Source)
at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.jav a:102)
this does not happen under RCP.
is this a bug in RAP ?
thanks & regards,
sudesh
[Updated on: Sun, 09 January 2011 17:14] Report message to a moderator
|
|
|
Re: Phase Listener Error [message #647866 is a reply to message #647822] |
Mon, 10 January 2011 08:24 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Sudesh,
It looks likes there is a Composite in your application that has a
FillLayout, but FormData. From the stack trace I can't say much about
it. You could try to run your application against RAP from CVS HEAD - we
recently updated the workbench and jface/databinding to 3.7M2. Maybe the
problem is in the old workbench code??!!
Anyway, please open a bug with a snippet to reproduce it.
Thanks,
Ivan
On 1/9/2011 7:10 PM, Sudesh Bulathsinhala wrote:
> hello,
>
> we're developing single-source product which supports both RCP and RAP.
>
> when RAP entry-point is invoked, everything seemed to work as
> expected, except we get the following error message everytime when we
> open an editor or dialog.
>
> ERROR
> 2011-01-09 08:58:09.189:WARN:/:ERROR: Could not execute PhaseListener
> after phase 'PROCESS_ACTION'.
> java.lang.ClassCastException: org.eclipse.swt.layout.FormData cannot
> be cast to org.eclipse.swt.layout.FillData
> at org.eclipse.swt.layout.FillLayout.flushCache(FillLayout.java
> :164)
> at org.eclipse.swt.widgets.Composite.changed(Composite.java:603 )
> at org.eclipse.swt.internal.graphics.TextSizeDeterminationHandl
> er$1.doVisit(TextSizeDeterminationHandler.java:86)
> at org.eclipse.swt.internal.widgets.WidgetTreeVisitor$AllWidget
> TreeVisitor.visit(WidgetTreeVisitor.java:35)
> at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi
> dgetTreeVisitor.java:49)
> at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi
> dgetTreeVisitor.java:56)
> at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi
> dgetTreeVisitor.java:56)
> at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi
> dgetTreeVisitor.java:56)
> at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi
> dgetTreeVisitor.java:56)
> at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(Wi
> dgetTreeVisitor.java:56)
> at org.eclipse.swt.internal.graphics.TextSizeDeterminationHandl
> er.afterPhase(TextSizeDeterminationHandler.java:133)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.afterPhaseEx
> ecution(RWTLifeCycle.java:371)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.continueLife
> Cycle(RWTLifeCycle.java:208)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLif
> eCycle.java:295)
> at org.eclipse.swt.widgets.Display.sleep(Display.java:1128)
> at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(Wo
> rkbenchAdvisor.java:361)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav
> a:2391)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2351)
> at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:22 06)
> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:424)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault
> (Realm.java:332)
> at org.eclipse.jface.internal.databinding.realmadapter.RealmAda
> pter.run(RealmAdapter.java:44)
> at org.eclipse.rap.ui.internal.RealmAdapterHook.runWithDefault(
> RealmAdapterHook.java:48)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work
> bench.java:427)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j
> ava:157)
> at com.argos.sys.client.entrypoint._rap.ClientEntryPoint.create
> UI(ClientEntryPoint.java:18)
> at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU
> I(EntryPointManager.java:92)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT
> LifeCycle.java:245)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont
> roller.run(RWTLifeCycle.java:114)
> at java.lang.Thread.run(Unknown Source)
> at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.jav
> a:102)
>
> this does not happen under RCP. is this a bug in RAP ?
>
> thanks & regards,
> sudesh
|
|
|
Re: Phase Listener Error [message #647944 is a reply to message #647822] |
Mon, 10 January 2011 15:01 |
Paul Bilnoski Messages: 28 Registered: August 2010 |
Junior Member |
|
|
Sudesh Bulathsinhala wrote on Sun, 09 January 2011 12:10 | hello,
we're developing single-source product which supports both RCP and RAP.
when RAP entry-point is invoked, everything seemed to work as expected, except we get the following error message everytime when we open an editor or dialog.
(the editor opens correctly and all the widgets are placed properly and it's behavior is normal, except the error message)
<snip>
this does not happen under RCP.
is this a bug in RAP ?
thanks & regards,
sudesh
|
My team experienced similar problems when migrating from RCP to RAP. The source of our problems was that we were assuming the layout of parent composites passed in to workbench parts. The solution is to not make this assumption and follow one of two options.
My preference is to allow the calling code to set layout on the composite and layout data on the resulting children. Client code really should not assume layouts of calling code since it breaks modularity. The caller should set a FillLayout or other proper layout and set up children as apporpriate.
The second option is to test the layout of the incoming parent Composite before setting layout data in children controls created from it. If it is an expected layout, then set the layout data, otherwise let the caller take this responsibility. An ugly corollary to this is to set the layout of an incoming parent composite to what you need it to be, as I have seen done before but would not recommend.
This is not specifically a problem with RAP - the workbench should be free to change the layouts used by composites passed to contributions. It is a problem with assumption of which piece of code carries certain responsibilities with respect to layouts and layout constraints.
--Paul
|
|
|
|
Powered by
FUDForum. Page generated in 0.02336 seconds