Invalid thread access problem [message #128182] |
Thu, 16 April 2009 08:44  |
Eclipse User |
|
|
|
Originally posted by: markus.wolf.nmmn.com
We have a problem with 'Invalid thread access' exceptions.
After some time clicking on our RWT application this exceptions occur.
Therefore I printed the displays thread and the current executing thread
to check them.
The result seems strange to me:
Current Displays Thread:
Thread[UIThread [615E4AB262B5F273689BB8AC9FA879DC],5,main]
Current Thread:
Thread[UIThread [615E4AB262B5F273689BB8AC9FA879DC],5,main]
The exception trace:
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:2572)
at org.eclipse.swt.SWT.error(SWT.java:2492)
at org.eclipse.swt.SWT.error(SWT.java:2463)
at org.eclipse.swt.widgets.Widget.error(Widget.java:832)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:762)
at org.eclipse.swt.custom.CTabFolder.getItemCount
(CTabFolder.java:276)
at org.eclipse.swt.custom.CTabItem.<init>(CTabItem.java:92)
at de.nmmn.iscontrol.rwt.ui.View.create(View.java:30)
at de.nmmn.iscontrol.rwt.ui.ViewPlaceholder.openView
(ViewPlaceholder.java:52)
at de.nmmn.iscontrol.rwt.action.OpenInBrowserAction.run
(OpenInBrowserAction.java:87)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:500 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection
(ActionContributionItem.java:579)
at org.eclipse.jface.action.ActionContributionItem.access$2
(ActionContributionItem.java:496)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t
(ActionContributionItem.java:407)
at
org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatc hEvent
(UntypedEventAdapter.java:469)
at
org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetS elected
(UntypedEventAdapter.java:89)
at org.eclipse.swt.events.SelectionEvent.dispatchToObserver
(SelectionEvent.java:176)
at org.eclipse.rwt.internal.events.Event.processEvent
(Event.java:44)
at org.eclipse.swt.events.TypedEvent.processEvent
(TypedEvent.java:125)
at org.eclipse.swt.events.TypedEvent.executeNext
(TypedEvent.java:165)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.readAndDispa tch
(RWTLifeCycle.java:241)
at org.eclipse.swt.widgets.Display.readAndDispatch
(Display.java:721)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:836 )
at org.eclipse.jface.window.Window.open(Window.java:812)
at de.nmmn.iscontrol.rwt.Main.createUI(Main.java:81)
at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I
(EntryPointManager.java:92)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI
(RWTLifeCycle.java:228)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle
$UIThreadController.run(RWTLifeCycle.java:116)
at java.lang.Thread.run(Thread.java:619)
Does anyone observes the same problem? The threads seem to be the same
but the exception is thrown anyway.
Markus Wolf
--
NMMN - New Media Markets & Networks GmbH
Geschäftsführung: Kfm. Michael Schütt
Finanzamt HH-Altona UStID DE 812 699 852 HRB 71102 Hamburg
HypoVereinsbank - BLZ 200 300 00 - Konto-Nr. 156 29 82
http://www.nmmn.com Tel.: +49 40 284 118 -0
Langbehnstrasse 6 Entwicklung: -720
22761 Hamburg Fax: -999
|
|
|
|
|
Re: Invalid thread access problem [message #128249 is a reply to message #128225] |
Thu, 16 April 2009 11:21  |
Eclipse User |
|
|
|
Originally posted by: markus.wolf.nmmn.com
Hi Ben,
> somehow this smells like discouraged use of static objects. I also hab
> problems with such 'strange' invalid thread accesses. The reason was
> that i wasn't aware that objects, like widgets etc., which are declared
> as static are shared between the hole application. So when several user
> used the application and accessed the same static widget this exception
> occurs. So i hope you are aware of this multi-session programming
> paradigm?!
>
thanks for reminding me. I was aware of the problem and it was not really
a static widget, but a singleton helper class chaching some widgets...
Now everything runs fine. :)
Thanks again.
Markus Wolf
--
NMMN - New Media Markets & Networks GmbH
Geschäftsführung: Kfm. Michael Schütt
Finanzamt HH-Altona UStID DE 812 699 852 HRB 71102 Hamburg
HypoVereinsbank - BLZ 200 300 00 - Konto-Nr. 156 29 82
http://www.nmmn.com Tel.: +49 40 284 118 -0
Langbehnstrasse 6 Entwicklung: -720
22761 Hamburg Fax: -999
|
|
|
Powered by
FUDForum. Page generated in 0.03906 seconds