Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Widget Disposed Exception with RAP 1.3M4
Widget Disposed Exception with RAP 1.3M4 [message #511908] Wed, 03 February 2010 12:03 Go to next message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
hi, i got the following problem:

i have a login composite for a rap app created and it is loaded before the main windows is shown:

public int login() {
refresh();
if (login.open() == Dialog.OK) {
String username = login.getUsername();
String password = login.getPassword();
if (UserManagement.getInstance().authenticate(new LoginRequest(new UserBean(username, password), RWT.getRequest().getRemoteAddr()))) {
Shell shell = new Shell(PlatformUI.createDisplay(), SWT.NO_TRIM | SWT.ON_TOP);
WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
Remote.getInstance().addActiveUser(UserManagement.getInstanc e().getActiveUser().getUserId(), shell.getDisplay());
UserManagement.getInstance().addUserSession(UserManagement.g etInstance().getActiveUser());
PlatformUI.createAndRunWorkbench(shell.getDisplay(), advisor);
} else {
// show errormessage
}



it worked fine with RAP 1.3 M3 but now i wanted to switch to M$ to use drag & drop but on the red codeline im getting the following ecxeption::
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:2687)
at org.eclipse.swt.SWT.error(SWT.java:2607)
at org.eclipse.swt.SWT.error(SWT.java:2578)
at org.eclipse.swt.widgets.Widget.error(Widget.java:892)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:828)
at org.eclipse.swt.widgets.Widget.getData(Widget.java:208)
at org.eclipse.ui.internal.Workbench.getActiveWorkbenchWindow(W orkbench.java:1074)
at org.eclipse.ui.internal.services.ActivePartSourceProvider.ge tCurrentState(ActivePartSourceProvider.java:248)
at org.eclipse.ui.internal.services.ExpressionAuthority.addSour ceProvider(ExpressionAuthority.java:89)
at org.eclipse.ui.internal.services.EvaluationService.addSource Provider(EvaluationService.java:75)
at org.eclipse.ui.internal.Workbench$38.runWithException(Workbe nch.java:1607)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:32)
at org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:115)
at org.eclipse.swt.widgets.Display$2.run(Display.java:909)
at org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 460)
at org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:907)
at org.eclipse.ui.internal.StartupThreading.runWithoutException s(StartupThreading.java:110)
at org.eclipse.ui.internal.Workbench.initializeDefaultServices( Workbench.java:1600)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1300)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2317)
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 acsa.versand.run.ApplicationContext.showWorkbech(Application Context.java:92)

any idea what changed since M3 to cause this?

thx, Edin
Re: Widget Disposed Exception with RAP 1.3M4 [message #511925 is a reply to message #511908] Wed, 03 February 2010 12:47 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi Edin,

I'm not aware of any changes in this area and how a disposed shell could
be the Displays active shell. Are you able to build a small entrypoint
to reproduce this? I already tried to reproduce it but without any
success. You may even want to check against CVS HEAD if this is still an
issue.
If you can reproduce it, please open a bug report with a snippet. Thanks!

Regards,
Ben

ededagic wrote:
> hi, i got the following problem:
>
> i have a login composite for a rap app created and it is loaded before
> the main windows is shown:
>
> public int login() {
> refresh();
> if (login.open() == Dialog.OK) {
> String username = login.getUsername();
> String password = login.getPassword();
> if (UserManagement.getInstance().authenticate(new
> LoginRequest(new UserBean(username, password),
> RWT.getRequest().getRemoteAddr()))) {
> Shell shell = new Shell(PlatformUI.createDisplay(),
> SWT.NO_TRIM | SWT.ON_TOP);
> WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
> Remote.getInstance().addActiveUser(UserManagement.getInstanc
> e().getActiveUser().getUserId(), shell.getDisplay());
> UserManagement.getInstance().addUserSession(UserManagement.g
> etInstance().getActiveUser());
> PlatformUI.createAndRunWorkbench(shell.getDisplay(), advisor);
> } else {
> // show errormessage
> }
>
>
>
> it worked fine with RAP 1.3 M3 but now i wanted to switch to M$ to use
> drag & drop but on the red codeline im getting the following ecxeption::
> org.eclipse.swt.SWTException: Widget is disposed
> at org.eclipse.swt.SWT.error(SWT.java:2687)
> at org.eclipse.swt.SWT.error(SWT.java:2607)
> at org.eclipse.swt.SWT.error(SWT.java:2578)
> at org.eclipse.swt.widgets.Widget.error(Widget.java:892)
> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:828)
> at org.eclipse.swt.widgets.Widget.getData(Widget.java:208)
> at org.eclipse.ui.internal.Workbench.getActiveWorkbenchWindow(W
> orkbench.java:1074)
> at org.eclipse.ui.internal.services.ActivePartSourceProvider.ge
> tCurrentState(ActivePartSourceProvider.java:248)
> at org.eclipse.ui.internal.services.ExpressionAuthority.addSour
> ceProvider(ExpressionAuthority.java:89)
> at org.eclipse.ui.internal.services.EvaluationService.addSource
> Provider(EvaluationService.java:75)
> at org.eclipse.ui.internal.Workbench$38.runWithException(Workbe
> nch.java:1607)
> at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run
> (StartupThreading.java:32)
> at org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync
> (UICallBackManager.java:115)
> at org.eclipse.swt.widgets.Display$2.run(Display.java:909)
> at org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler.
> runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 460)
> at org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC
> ontext(UICallBack.java:44)
> at org.eclipse.swt.widgets.Display.syncExec(Display.java:907)
> at org.eclipse.ui.internal.StartupThreading.runWithoutException
> s(StartupThreading.java:110)
> at org.eclipse.ui.internal.Workbench.initializeDefaultServices(
> Workbench.java:1600)
> at org.eclipse.ui.internal.Workbench.init(Workbench.java:1300)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2317)
> 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 acsa.versand.run.ApplicationContext.showWorkbech(Application
> Context.java:92)
>
> any idea what changed since M3 to cause this?
> thx, Edin


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: Widget Disposed Exception with RAP 1.3M4 [message #512514 is a reply to message #511925] Fri, 05 February 2010 10:53 Go to previous messageGo to next message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
Hello,

today i set the target platform to the new M5, and now it seems to work. So i think there is no need more to check whether it was a bug or not, now its away.

Greetings, Edin
Re: Widget Disposed Exception with RAP 1.3M4 [message #519551 is a reply to message #512514] Tue, 09 March 2010 05:06 Go to previous messageGo to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
ededagic schrieb:
> Hello,
> today i set the target platform to the new M5, and now it seems to work.
> So i think there is no need more to check whether it was a bug or not,
> now its away.
>
> Greetings, Edin


Hi,
I get the same problem with RAP 1.3.0M5. The Exception is:


org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:2841)
at org.eclipse.swt.SWT.error(SWT.java:2761)
at org.eclipse.swt.SWT.error(SWT.java:2732)
at org.eclipse.swt.widgets.Widget.error(Widget.java:954)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:890)
at org.eclipse.swt.widgets.Text.getText(Text.java:169)
at de.myapp.list.MyDialog.getReason(MyDialog.java:80)


MyDialog is a class which extends MessageDialog, and getReason is a
getter for the private field "reason". If I call this method, the
exception occurs. In RAP 1.2.2 this worked. Any ideas?

TIA,
Ralf.
Re: Widget Disposed Exception with RAP 1.3M4 [message #519559 is a reply to message #519551] Tue, 09 March 2010 10:18 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Ralf,

make sure your widget is not disposed, i.e. Text#isDisposed returns false.

HTH
Rüdiger

On 09.03.2010 10:55, R. Heydenreich wrote:
> ededagic schrieb:
>> Hello,
>> today i set the target platform to the new M5, and now it seems to work.
>> So i think there is no need more to check whether it was a bug or not,
>> now its away.
>>
>> Greetings, Edin
>
>
> Hi,
> I get the same problem with RAP 1.3.0M5. The Exception is:
>
>
> org.eclipse.swt.SWTException: Widget is disposed
> at org.eclipse.swt.SWT.error(SWT.java:2841)
> at org.eclipse.swt.SWT.error(SWT.java:2761)
> at org.eclipse.swt.SWT.error(SWT.java:2732)
> at org.eclipse.swt.widgets.Widget.error(Widget.java:954)
> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:890)
> at org.eclipse.swt.widgets.Text.getText(Text.java:169)
> at de.myapp.list.MyDialog.getReason(MyDialog.java:80)
>
>
> MyDialog is a class which extends MessageDialog, and getReason is a
> getter for the private field "reason". If I call this method, the
> exception occurs. In RAP 1.2.2 this worked. Any ideas?
>
> TIA,
> Ralf.
Re: Widget Disposed Exception with RAP 1.3M4 [message #519631 is a reply to message #519559] Tue, 09 March 2010 09:44 Go to previous messageGo to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Rüdiger Herrmann schrieb:
> Ralf,
>
> make sure your widget is not disposed, i.e. Text#isDisposed returns false.

This is not the case, isDisposed() returns true. But how can I achieve
that the widget isn't disposed if I press the OK button?

TIA,
Ralf.


> On 09.03.2010 10:55, R. Heydenreich wrote:
>> ededagic schrieb:
>>> Hello,
>>> today i set the target platform to the new M5, and now it seems to work.
>>> So i think there is no need more to check whether it was a bug or not,
>>> now its away.
>>>
>>> Greetings, Edin
>>
>>
>> Hi,
>> I get the same problem with RAP 1.3.0M5. The Exception is:
>>
>>
>> org.eclipse.swt.SWTException: Widget is disposed
>> at org.eclipse.swt.SWT.error(SWT.java:2841)
>> at org.eclipse.swt.SWT.error(SWT.java:2761)
>> at org.eclipse.swt.SWT.error(SWT.java:2732)
>> at org.eclipse.swt.widgets.Widget.error(Widget.java:954)
>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:890)
>> at org.eclipse.swt.widgets.Text.getText(Text.java:169)
>> at de.myapp.list.MyDialog.getReason(MyDialog.java:80)
>>
>>
>> MyDialog is a class which extends MessageDialog, and getReason is a
>> getter for the private field "reason". If I call this method, the
>> exception occurs. In RAP 1.2.2 this worked. Any ideas?
>>
>> TIA,
>> Ralf.
Re: Widget Disposed Exception with RAP 1.3M4 [message #519734 is a reply to message #519631] Tue, 09 March 2010 14:32 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Ralf,

you'd rather want to preserve the value of the text widget before the
dialog gets disposed of, e.g. in okPressed().

HTH
Rüdiger

On 09.03.2010 15:39, R. Heydenreich wrote:
> Rüdiger Herrmann schrieb:
>> Ralf,
>>
>> make sure your widget is not disposed, i.e. Text#isDisposed returns false.
>
> This is not the case, isDisposed() returns true. But how can I achieve
> that the widget isn't disposed if I press the OK button?
>
> TIA,
> Ralf.
>
>
>> On 09.03.2010 10:55, R. Heydenreich wrote:
>>> ededagic schrieb:
>>>> Hello,
>>>> today i set the target platform to the new M5, and now it seems to work.
>>>> So i think there is no need more to check whether it was a bug or not,
>>>> now its away.
>>>>
>>>> Greetings, Edin
>>>
>>>
>>> Hi,
>>> I get the same problem with RAP 1.3.0M5. The Exception is:
>>>
>>>
>>> org.eclipse.swt.SWTException: Widget is disposed
>>> at org.eclipse.swt.SWT.error(SWT.java:2841)
>>> at org.eclipse.swt.SWT.error(SWT.java:2761)
>>> at org.eclipse.swt.SWT.error(SWT.java:2732)
>>> at org.eclipse.swt.widgets.Widget.error(Widget.java:954)
>>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:890)
>>> at org.eclipse.swt.widgets.Text.getText(Text.java:169)
>>> at de.myapp.list.MyDialog.getReason(MyDialog.java:80)
>>>
>>>
>>> MyDialog is a class which extends MessageDialog, and getReason is a
>>> getter for the private field "reason". If I call this method, the
>>> exception occurs. In RAP 1.2.2 this worked. Any ideas?
>>>
>>> TIA,
>>> Ralf.


--
Rüdiger Herrmann
http://eclipsesource.com
Re: Widget Disposed Exception with RAP 1.3M4 [message #519841 is a reply to message #519734] Wed, 10 March 2010 02:50 Go to previous message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Rüdiger Herrmann schrieb:
> Ralf,
>
> you'd rather want to preserve the value of the text widget before the
> dialog gets disposed of, e.g. in okPressed().
>
> HTH

Ah, ok, this works. Thanks a lot.

Ralf.

> Rüdiger
>
> On 09.03.2010 15:39, R. Heydenreich wrote:
>> Rüdiger Herrmann schrieb:
>>> Ralf,
>>>
>>> make sure your widget is not disposed, i.e. Text#isDisposed returns
>>> false.
>>
>> This is not the case, isDisposed() returns true. But how can I achieve
>> that the widget isn't disposed if I press the OK button?
>>
>> TIA,
>> Ralf.
>>
>>
>>> On 09.03.2010 10:55, R. Heydenreich wrote:
>>>> ededagic schrieb:
>>>>> Hello,
>>>>> today i set the target platform to the new M5, and now it seems to
>>>>> work.
>>>>> So i think there is no need more to check whether it was a bug or
>>>>> not,
>>>>> now its away.
>>>>>
>>>>> Greetings, Edin
>>>>
>>>>
>>>> Hi,
>>>> I get the same problem with RAP 1.3.0M5. The Exception is:
>>>>
>>>>
>>>> org.eclipse.swt.SWTException: Widget is disposed
>>>> at org.eclipse.swt.SWT.error(SWT.java:2841)
>>>> at org.eclipse.swt.SWT.error(SWT.java:2761)
>>>> at org.eclipse.swt.SWT.error(SWT.java:2732)
>>>> at org.eclipse.swt.widgets.Widget.error(Widget.java:954)
>>>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:890)
>>>> at org.eclipse.swt.widgets.Text.getText(Text.java:169)
>>>> at de.myapp.list.MyDialog.getReason(MyDialog.java:80)
>>>>
>>>>
>>>> MyDialog is a class which extends MessageDialog, and getReason is a
>>>> getter for the private field "reason". If I call this method, the
>>>> exception occurs. In RAP 1.2.2 this worked. Any ideas?
>>>>
>>>> TIA,
>>>> Ralf.
>
>
Previous Topic:Load plug-in dynamically
Next Topic:Custom variant styling on CTabITem does not set the background completely.
Goto Forum:
  


Current Time: Thu Apr 25 03:32:59 GMT 2024

Powered by FUDForum. Page generated in 0.03631 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top