| Summary: | [Compatibility] IAE thrown when trying to open a part in an asyncExec | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Remy Suen <remy.suen> | ||||||||
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> | ||||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | eiswind, emoffatt, pwebster, tom.schindl | ||||||||
| Version: | 4.1 | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | stalebug | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Remy Suen
Hi Thomas, when this happens, do you have any other parts in the same stack as the editor that is going to be opened in? Also, do you remember if you have been seeing this for some time or did you only started seeing it after we added code to let you open views in the shared area? Hi Remy, I have seen it happen when I open the first part in the shared area. At most I remeber it after application startup. Don't know exactly if it relates to the views in the shared area, I am watching this for quite a while. As it happens only sometimes, I took a heart today and reported it. (In reply to comment #3) > Hi Remy, I have seen it happen when I open the first part in the shared area. > At most I remeber it after application startup. Very interesting. So you mean there were actually no rendered parts in the shared area when this happens? Today I won't tell for sure what happened yesterday :( But I also remember seeing it happen twice when the part gets created at startup by an elementFactory Do you call setVisible(boolean) on (Eclipse 4) model elements anywhere in your code? That's the only reason I can think of why the index calculation could be off at the moment. I have released some fixes for this problem (bug 342439) to HEAD. One possible case of this bug has been fixed though I can't say for sure if this is the problem you're seeing. One "guaranteed" workaround for this problem would be to just check the index before we actually try to create the tab item. This would prevent the IAE but could potentially leave the model in a strange state farther down the road as it implies the widgets and the model is not in sync. No I don't do any changes on the e4 model by now. It's just my 3.x code. And you think it's not related to the NPE with the missing context I see happen before this one? (In reply to comment #7) > No I don't do any changes on the e4 model by now. It's just my 3.x code. > And you think it's not related to the NPE with the missing context I see happen > before this one? That error comes after this SWT problem though. The context is null because the part could not be rendered. The part could not be rendered because the tab item couldn't even get constructed. do you think we could place any traces in the code so that we get a better understanding if i see it happen again ? (In reply to comment #9) > do you think we could place any traces in the code so that we get a better > understanding if i see it happen again ? Right now are you using deltas to restore the model or do you have it save the EMF model to disk? Hi Remy, I'm quite stupid when it comes to e4 :) Unfortunately I don't even know how to answer your question. I just took my 3.x bundles to e4 and threw the LegacyIDE.xml in. Have no clue how the model get's stored, sorry. But I would be glad if I could learn something. (In reply to comment #11) > Have no clue how the model get's stored, sorry. But I > would be glad if I could learn something. I guess you have the default behaviour right now then. If you add '-deltaRestore false' as arguments to your RCP application then it will save the EMF model to disk when it shuts down. After the problem occurs, shutdown Eclipse and then look for this file (.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi) and then attach it to this bug. (In reply to comment #12) > (In reply to comment #11) > > Have no clue how the model get's stored, sorry. But I > > would be glad if I could learn something. > > I guess you have the default behaviour right now then. > > If you add '-deltaRestore false' as arguments to your RCP application then it > will save the EMF model to disk when it shuts down. After the problem occurs, > shutdown Eclipse and then look for this file > (.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi) and then attach it > to this bug. It's even easier to the the current e4xmi. Simply open the Live-Modeltooling switch to the XMI-Tab and copy the content from there. You need the last I-Builds so that C&P works there IIRC. If that is not working I'm going to fix it ASAP. >
> It's even easier to the the current e4xmi. Simply open the Live-Modeltooling
> switch to the XMI-Tab and copy the content from there. You need the last
> I-Builds so that C&P works there IIRC. If that is not working I'm going to fix
> it ASAP.
Just tried and it even works in M6 already!
I'll give this a try. Can take a while 'til it happens again. Thanks as ever. I have seen this today again. sadly it was in a presentation so that I couldn't get the xmi. But after restart I had an empty editor with the respective couldn't find... message in it in the shared area. If this is of help, I do not know. (In reply to comment #16) > I have seen this today again. sadly it was in a presentation so that I > couldn't get the xmi. I am sorry to hear that Thomas, I hope the presentation still went okay. :/ Eric, according to Thomas, this problem prevents editors ever from opening again [1] so I think we should add a point fix to the StackRenderer to workaround this problem. What do you think? [1] - http://dev.eclipse.org/mhonarc/lists/e4-dev/msg05053.html Hi I promised that it was a beta problem ... Thomas, what was your shared area like? I know you wanted to add views in there so I know you have both views and editors inside. Do you have multiple stacks or only one single tab folder? Did you ever try minimizing the shared area or removing parts from the workbench window into a detached window? HI Remy, I'm working with the xmi from the platform plugin, so I only can guess I have a single tab folder there. minimizing and moving works fine but I only tried this now, normally I do not show this feature. Thomas, I just finished talking with Remy about this defect. My advice was to not try to address this until 4.1 goes out, mostly because we really don't understand the basic issue in the code flow (yet). ...but...once 4.1 goes out we should get together on an e4 call and go over this specific issue. I'm very interested since a proper solution to this may make the whole rendering engine much more robust in multi-threaded envs... Today I have seen the following: org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException) at org.eclipse.swt.SWT.error(SWT.java:4277) at org.eclipse.swt.SWT.error(SWT.java:4192) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4138) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3755) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:890) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:806) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:87) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:542) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:522) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at de.eiswind.paris.client.core.Application.start(Application.java:45) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) Caused by: java.lang.NullPointerException at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.activate(PartActivationHistory.java:52) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:518) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:477) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:466) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:899) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2675) at org.eclipse.ui.internal.WorkbenchPage.access$19(WorkbenchPage.java:2624) at org.eclipse.ui.internal.WorkbenchPage$7.run(WorkbenchPage.java:2606) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2602) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2582) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2565) at de.eiswind.mango.client.workflow.handlers.FindTasksHandler$2$1.run(FindTasksHandler.java:61) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) ... 24 more java.lang.NullPointerException at org.eclipse.e4.ui.widgets.CTabItem.getFont(CTabItem.java:195) at org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper.getFont(CSSSWTFontHelper.java:401) at org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper.getCSS2FontProperties(CSSSWTFontHelper.java:73) at org.eclipse.e4.ui.css.swt.properties.css2.CSSPropertyFontSWTHandler.applyCSSProperty(CSSPropertyFontSWTHandler.java:65) at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyCSSProperty(AbstractCSSEngine.java:720) at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyleDeclaration(AbstractCSSEngine.java:485) at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:402) at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:342) at org.eclipse.e4.ui.css.swt.engine.CSSSWTApplyStylesListener$1.handleEvent(CSSSWTApplyStylesListener.java:31) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4337) at org.eclipse.swt.widgets.Display.runSkin(Display.java:4246) at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:227) at org.eclipse.jface.window.Window.getInitialSize(Window.java:594) at org.eclipse.jface.dialogs.Dialog.getInitialSize(Dialog.java:1196) at org.eclipse.jface.window.Window.initializeBounds(Window.java:764) at org.eclipse.jface.dialogs.Dialog.initializeBounds(Dialog.java:714) at org.eclipse.jface.window.Window.create(Window.java:435) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089) at org.eclipse.jface.window.Window.open(Window.java:790) at org.eclipse.jface.dialogs.ErrorDialog.open(ErrorDialog.java:360) at org.eclipse.e4.ui.internal.workbench.swt.WorkbenchStatusReporter.openDialog(WorkbenchStatusReporter.java:97) at org.eclipse.e4.ui.internal.workbench.swt.WorkbenchStatusReporter.report(WorkbenchStatusReporter.java:54) at org.eclipse.e4.core.services.statusreporter.StatusReporter.show(StatusReporter.java:132) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.safeHandle(PartRenderingEngine.java:927) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.handle(PartRenderingEngine.java:911) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:899) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:806) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:87) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:542) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:522) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at de.eiswind.paris.client.core.Application.start(Application.java:45) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) java.lang.NullPointerException at org.eclipse.e4.ui.widgets.CTabItem.getFont(CTabItem.java:195) at org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper.getFont(CSSSWTFontHelper.java:401) at org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper.getCSS2FontProperties(CSSSWTFontHelper.java:73) at org.eclipse.e4.ui.css.swt.properties.css2.CSSPropertyFontSWTHandler.applyCSSProperty(CSSPropertyFontSWTHandler.java:65) at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyCSSProperty(AbstractCSSEngine.java:720) at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyleDeclaration(AbstractCSSEngine.java:485) at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:402) at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:342) at org.eclipse.e4.ui.css.swt.engine.CSSSWTApplyStylesListener$1.handleEvent(CSSSWTApplyStylesListener.java:31) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4337) at org.eclipse.swt.widgets.Display.runSkin(Display.java:4246) at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:227) at org.eclipse.jface.window.Window.getInitialSize(Window.java:594) at org.eclipse.jface.dialogs.Dialog.getInitialSize(Dialog.java:1196) at org.eclipse.jface.window.Window.initializeBounds(Window.java:764) at org.eclipse.jface.dialogs.Dialog.initializeBounds(Dialog.java:714) at org.eclipse.jface.window.Window.create(Window.java:435) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089) at org.eclipse.jface.window.Window.open(Window.java:790) at org.eclipse.jface.dialogs.ErrorDialog.open(ErrorDialog.java:360) at org.eclipse.e4.ui.internal.workbench.swt.WorkbenchStatusReporter.openDialog(WorkbenchStatusReporter.java:97) at org.eclipse.e4.ui.internal.workbench.swt.WorkbenchStatusReporter.report(WorkbenchStatusReporter.java:54) at org.eclipse.e4.core.services.statusreporter.StatusReporter.show(StatusReporter.java:132) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.safeHandle(PartRenderingEngine.java:927) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.handle(PartRenderingEngine.java:911) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:899) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:806) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:87) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:542) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:522) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at de.eiswind.paris.client.core.Application.start(Application.java:45) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) Can you give me any advice how I could prevent this exception ? It's a showstopper for building a new release, I won't present this to my customers at this stage. (In reply to comment #23) > Can you give me any advice how I could prevent this exception ? You are talking about the exception in comment 22, correct? I'd love to prevent this NPE with the font as well as the IAE when opening the editor from my Jobs. Are the newer exceptions consistently reproducible or do they also happen at random? I still cannot reproduce them, they seem to happen randomly, especially when a customer is watching my demonstrations :( maybe I should invite a customer to stay at my side to reproduce them :( (In reply to comment #27) > I still cannot reproduce them, they seem to happen randomly Do you open all your editors with jobs? If not, are the ones that are not opened with jobs safe? (In reply to comment #22) > Caused by: java.lang.NullPointerException > at > org.eclipse.e4.ui.internal.workbench.PartActivationHistory.activate(PartActivationHistory.java:52) > at > org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:518) > at > org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:477) > at > org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:466) > at > org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:899) > at > org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2675) > at org.eclipse.ui.internal.WorkbenchPage.access$19(WorkbenchPage.java:2624) > at org.eclipse.ui.internal.WorkbenchPage$7.run(WorkbenchPage.java:2606) > at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) > at > org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2602) > at > org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2582) > at > org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2565) > at > de.eiswind.mango.client.workflow.handlers.FindTasksHandler$2$1.run(FindTasksHandler.java:61) > at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) > at > org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) > ... 24 more For this exception, is there no other information before it? In the original problem we see there is an IAE problem creating the tab but this new one seems to be when it's trying to skin the tab items after the errors have been logged. Indeed it's a single extensible Job that's responsible for opening all kinds of editors, as creating the input is expensive (database roundtrip) and I wanted to have at least some ui feedback. I provided the whole stacktrace I've seen on the weekend. Thats it :( Created attachment 197408 [details]
StackRenderer patch v1
Hi Thomas, this patch should prevent the original problem you reported to us (the IAE problem).
If we detect the index is off, we will reset it and make it so that the tab appears at the end. We will also attempt to log which part(s) have been found that should be rendered on screen but don't actually appear to be there (that is, we can't find its representing tab item).
Thanks Remy, I'll go into this on the weekend. I finally can reproduce it. But deltastore false doesn't have any effect, and I fail to install the tooling on my M7 platform because of unsatisfied emf dependencies. I might go crazy. Thats what I do: Open View in shared area, Open Editor A, Close View, Open Editor B (must be a different editor) boom. (In reply to comment #32) > Thats what I do: Open View in shared area, Open Editor A, Close View, Open > Editor B (must be a different editor) boom. Is editor A up and opened at this time or is the job still talking to the database? Editor a is open at this time. I can open different instances of A without hassle, it only fails if I open Editor B after closing the view. (In reply to comment #34) > Editor a is open at this time. I can open different instances of A without > hassle, it only fails if I open Editor B after closing the view. This is very, very odd. When you close the view, please check that PartServiceImpl's hidePart(MPart, boolean) method is called and that setToBeRendered(false) is called. When you open editor B, please check the StackRenderer's calcIndexFor(*) method and note every single model element that makes the index increment. Record the ids of the model elements that makes the value go up and check if their 'widget' is 'null' or not. 'null' values are bad. Created attachment 197856 [details]
Stacktrace snapshot
Hi Remy, I applied your patch today. Now I see the following: I close the view, its gone. I close another Editor, the view (magic) is back. I put a breakpoint in setToBeRendered and attach the stacktrace from where the viewPart is magically reactivated. Let me know if I can do further investigations.
PS after closing the view, when I open another editor in the otherwise empty shared area I see now your log msg !MESSAGE An element should have a tab but it could not be found: org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl@637a91a (elementId: org.eclipse.e4.ui.compatibility.editor, tags: [Editor], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (contributionURI: platform:/plugin/org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor, object: null, context: null, variables: null, label: null, iconURI: null, tooltip: null, dirty: false, closeable: true, description: null) Can it be that the view is taken to be an editorpart? (In reply to comment #36) > Created attachment 197856 [details] > Stacktrace snapshot > > Hi Remy, I applied your patch today. Now I see the following: I close the view, > its gone. I close another Editor, the view (magic) is back. This is very odd because in my test when I call getPart(true) I already have a part so it doesn't try to instantiate it. > Let me know if I can do further investigations. I also don't understand why closing an editor would send out a notification of a view being closed. Could you please use the context menu on the thread and copy the whole stack trace, Thomas? Thank you. Hi Remy, I found the following: If the view is the only part in the shared area, everything seems to be fine. If I open an Editor before I open the view and then close the view, setToBeRendered is invoked two times, at first from hidePart with false and then immediately with true from the event with the following stacktrace. The view ist still invisible then, but I think this makes the calcIndex go wrong. An if I then close the editor it gets rendered again. Thread [main] (Suspended (breakpoint at line 290 in UIElementImpl)) PartImpl(UIElementImpl).setToBeRendered(boolean) line: 290 PartServiceImpl.showPart(MPart, EPartService$PartState) line: 905 ViewReference(WorkbenchPartReference).getPart(boolean) line: 482 LockPartListener.getEntity(IWorkbenchPartReference) line: 50 LockPartListener.partClosed(IWorkbenchPartReference) line: 31 WorkbenchPage$17.run() line: 3845 SafeRunner.run(ISafeRunnable) line: 42 WorkbenchPage.firePartClosed(CompatibilityPart) line: 3843 CompatibilityPart$1.handleEvent(Event) line: 94 UIEventHandler$1.run() line: 41 UISynchronizer(Synchronizer).syncExec(Runnable) line: 180 UISynchronizer.syncExec(Runnable) line: 150 Display.syncExec(Runnable) line: 4681 E4Application$1.syncExec(Runnable) line: 182 UIEventHandler.handleEvent(Event) line: 38 EventHandlerWrapper.handleEvent(Event, Permission) line: 197 EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197 EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1 EventManager.dispatchEvent(Set, EventDispatcher, int, Object) line: 230 ListenerQueue.dispatchEventSynchronous(int, Object) line: 148 EventAdminImpl.dispatchEvent(Event, boolean) line: 135 EventAdminImpl.sendEvent(Event) line: 78 EventComponent.sendEvent(Event) line: 39 EventBroker.send(String, Object) line: 81 UIEventPublisher.notifyChanged(Notification) line: 58 PartImpl(BasicNotifierImpl).eNotify(Notification) line: 380 PartImpl(UIElementImpl).setWidget(Object) line: 250 ContributedPartRenderer(SWTPartRenderer).unbindWidget(MUIElement) line: 114 ContributedPartRenderer(SWTPartRenderer).disposeWidget(MUIElement) line: 135 ContributedPartRenderer.disposeWidget(MUIElement) line: 270 PartRenderingEngine.safeRemoveGui(MUIElement) line: 730 PartRenderingEngine.access$2(PartRenderingEngine, MUIElement) line: 674 PartRenderingEngine$6.run() line: 669 SafeRunner.run(ISafeRunnable) line: 42 PartRenderingEngine.removeGui(MUIElement) line: 654 ElementReferenceRenderer.disposeWidget(MUIElement) line: 108 PartRenderingEngine.safeRemoveGui(MUIElement) line: 730 PartRenderingEngine.access$2(PartRenderingEngine, MUIElement) line: 674 PartRenderingEngine$6.run() line: 669 SafeRunner.run(ISafeRunnable) line: 42 PartRenderingEngine.removeGui(MUIElement) line: 654 PartRenderingEngine$1.handleEvent(Event) line: 137 UIEventHandler$1.run() line: 41 UISynchronizer(Synchronizer).syncExec(Runnable) line: 180 UISynchronizer.syncExec(Runnable) line: 150 Display.syncExec(Runnable) line: 4681 E4Application$1.syncExec(Runnable) line: 182 UIEventHandler.handleEvent(Event) line: 38 EventHandlerWrapper.handleEvent(Event, Permission) line: 197 EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197 EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1 EventManager.dispatchEvent(Set, EventDispatcher, int, Object) line: 230 ListenerQueue.dispatchEventSynchronous(int, Object) line: 148 EventAdminImpl.dispatchEvent(Event, boolean) line: 135 EventAdminImpl.sendEvent(Event) line: 78 EventComponent.sendEvent(Event) line: 39 EventBroker.send(String, Object) line: 81 UIEventPublisher.notifyChanged(Notification) line: 58 PlaceholderImpl(BasicNotifierImpl).eNotify(Notification) line: 380 PlaceholderImpl(UIElementImpl).setToBeRendered(boolean) line: 292 PartServiceImpl.hidePart(MPart, boolean) line: 1005 PartServiceImpl.hidePart(MPart) line: 944 StackRenderer.closePart(Widget) line: 555 StackRenderer.access$6(StackRenderer, Widget) line: 540 StackRenderer$5.close(CTabFolderEvent) line: 523 CTabFolder.onMouse(Event) line: 1787 CTabFolder$1.handleEvent(Event) line: 275 EventTable.sendEvent(Event) line: 84 CTabFolder(Widget).sendEvent(Event) line: 1053 Display.runDeferredEvents() line: 4163 Display.readAndDispatch() line: 3752 PartRenderingEngine$7.run() line: 890 Realm.runWithDefault(Realm, Runnable) line: 332 PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 806 E4Workbench.createAndRunUI(MApplicationElement) line: 87 Workbench$3.run() line: 542 Realm.runWithDefault(Realm, Runnable) line: 332 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 522 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149 Application.start(IApplicationContext) line: 45 EclipseAppHandle.run(Object) line: 196 EclipseAppLauncher.runApplication(Object) line: 110 EclipseAppLauncher.start(Object) line: 79 EclipseStarter.run(Object) line: 344 EclipseStarter.run(String[], Runnable) line: 179 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 Main.invokeFramework(String[], URL[]) line: 622 Main.basicRun(String[]) line: 577 Main.run(String[]) line: 1410 Main.main(String[]) line: 1386 (In reply to comment #39) > I found the following: If the view is the only part in the shared area, > everything seems to be fine. If I open an Editor before I open the view and > then close the view, setToBeRendered is invoked two times, at first from > hidePart with false and then immediately with true from the event with the > following stacktrace. The view ist still invisible then, but I think this makes > the calcIndex go wrong. An if I then close the editor it gets rendered again. Hm, this is very weird indeed. Unfortunately, I still cannot reproduce the problem, Thomas. :/ Is your a view a multi-instance view (like the 'Console' view or 'Properties' view) or is there only one of them at a time? Could you please put a breakpoint in WorkbenchPartReference's invalidate() method? I want to see who is calling the method and making 'legacyPart' be set to 'null' (and causing your view to be instantiated again). Thank you. this is my view
<view
class="de.eiswind.paris.client.core.ui.valuelist.ValueListView2"
id="de.eiswind.paris.client.core.ui.valuelist.ValueListView2"
name="%valueLists">
</view>
it's single instance. the inavalidate looks unsuspicious to me
Thread [main] (Suspended (breakpoint at line 669 in WorkbenchPartReference))
ViewReference(WorkbenchPartReference).invalidate() line: 669
CompatibilityView(CompatibilityPart).invalidate() line: 168
CompatibilityView(CompatibilityPart).destroy() line: 318
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
MethodRequestor.execute() line: 56
InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 828
InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 808
InjectorImpl.uninject(Object, PrimaryObjectSupplier) line: 167
FieldRequestor(Requestor).uninject(Object, PrimaryObjectSupplier) line: 122
ContextObjectSupplier$ContextInjectionListener.update(IEclipseContext, int, Object[]) line: 69
TrackableComputationExt.update(ContextChangeEvent) line: 88
EclipseContext.removeListenersTo(Object) line: 439
ContextInjectionFactory.uninject(Object, IEclipseContext) line: 135
PartRenderingEngine.safeRemoveGui(MUIElement) line: 739
PartRenderingEngine.access$2(PartRenderingEngine, MUIElement) line: 674
PartRenderingEngine$6.run() line: 669
SafeRunner.run(ISafeRunnable) line: 42
PartRenderingEngine.removeGui(MUIElement) line: 654
ElementReferenceRenderer.disposeWidget(MUIElement) line: 108
PartRenderingEngine.safeRemoveGui(MUIElement) line: 730
PartRenderingEngine.access$2(PartRenderingEngine, MUIElement) line: 674
PartRenderingEngine$6.run() line: 669
SafeRunner.run(ISafeRunnable) line: 42
PartRenderingEngine.removeGui(MUIElement) line: 654
PartRenderingEngine$1.handleEvent(Event) line: 137
UIEventHandler$1.run() line: 41
UISynchronizer(Synchronizer).syncExec(Runnable) line: 180
UISynchronizer.syncExec(Runnable) line: 150
Display.syncExec(Runnable) line: 4681
E4Application$1.syncExec(Runnable) line: 182
UIEventHandler.handleEvent(Event) line: 38
EventHandlerWrapper.handleEvent(Event, Permission) line: 197
EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197
EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1
EventManager.dispatchEvent(Set, EventDispatcher, int, Object) line: 230
ListenerQueue.dispatchEventSynchronous(int, Object) line: 148
EventAdminImpl.dispatchEvent(Event, boolean) line: 135
EventAdminImpl.sendEvent(Event) line: 78
EventComponent.sendEvent(Event) line: 39
EventBroker.send(String, Object) line: 81
UIEventPublisher.notifyChanged(Notification) line: 58
PlaceholderImpl(BasicNotifierImpl).eNotify(Notification) line: 380
PlaceholderImpl(UIElementImpl).setToBeRendered(boolean) line: 292
PartServiceImpl.hidePart(MPart, boolean) line: 1005
PartServiceImpl.hidePart(MPart) line: 944
StackRenderer.closePart(Widget) line: 555
StackRenderer.access$6(StackRenderer, Widget) line: 540
StackRenderer$5.close(CTabFolderEvent) line: 523
CTabFolder.onMouse(Event) line: 1787
CTabFolder$1.handleEvent(Event) line: 275
EventTable.sendEvent(Event) line: 84
CTabFolder(Widget).sendEvent(Event) line: 1053
Display.runDeferredEvents() line: 4163
Display.readAndDispatch() line: 3752
PartRenderingEngine$7.run() line: 890
Realm.runWithDefault(Realm, Runnable) line: 332
PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 806
E4Workbench.createAndRunUI(MApplicationElement) line: 87
Workbench$3.run() line: 542
Realm.runWithDefault(Realm, Runnable) line: 332
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 522
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149
Application.start(IApplicationContext) line: 45
EclipseAppHandle.run(Object) line: 196
EclipseAppLauncher.runApplication(Object) line: 110
EclipseAppLauncher.start(Object) line: 79
EclipseStarter.run(Object) line: 344
EclipseStarter.run(String[], Runnable) line: 179
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
Main.invokeFramework(String[], URL[]) line: 622
Main.basicRun(String[]) line: 577
Main.run(String[]) line: 1410
Main.main(String[]) line: 1386
Created attachment 197878 [details]
CompatibilityView patch v1
Thomas, can you try this patch and tell me how it goes? Thanks.
Hi Remy, it works now! At least the view closes and I don't see any log messages anymore when opening editors. Thanks for your great support! So now it's up to make buckminster do what I need to get a release. (In reply to comment #43) > Hi Remy, it works now! At least the view closes and I don't see any log > messages anymore when opening editors. Great to hear. The problem is that in the SDK getPart(boolean) is called a lot and that field gets set by other listeners. In your case, it seems that it is not called as frequently so it is possible that a part reference will never have its field set correctly. If you have an IPartListener2 that listens to the partOpened(*) method then I think you might not have to change the workbench internals. public void partOpened(IWorkbenchPartReference partRef) { // force the field to get set partRef.getPart(false); } > Thanks for your great support! As always, thanks for testing Eclipse 4.1! I delivered attachment 198568 [details] to HEAD. It's a spot fix and the issue needs to be resolved more correctly later.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the stalebug whiteboard tag. |