Community
Participate
Working Groups
Build Identifier: I-3.3.0-20110305235707 1. With the diagram editor being opened, closing project cannot be done properly. 2. Closing the JPA project should close the diagram editor, but it does not. Reproducible: Always Steps to Reproduce: 1. Create a JPA project 2. Open the diagram editor 3. Try to close the JPA project -> Result 1 4. Open the diagram editor again 5. Create some entities and save 6. Try to close the JPA project -> Result 2 Result 1: A NPE is thrown saying "Problems occurred when invoking code from plug-in: "org.eclipse.core.resources"." The stack trace is attached. Result 2: Closing project operation gets hung up saying the user operation is waiting for "Close Project" to complete. From this point on, all the operations will be waiting including closing Eclipse. I have to kill the Eclipse process through the Windows task manager.
Created attachment 191124 [details] Stack Trace
Created attachment 195037 [details] patch This patch fixes only the issue that comes as e Result 2, because I wasn't able to reproduce the first one...
The patch works fine, but if the editor is dirty it should ask the user if she wants to save the changes before closing
Created attachment 195215 [details] proposed patch Now if the editor is dirty while the project is trying to be closed, a "Save Resource" dialog appears...
With the second patch at closing the project I often get: org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.core.internal.resources.ResourceException: Resource '/rewrw/diagrams/rewrw.xmi' does not exist.) 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:137) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4125) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3742) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) 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: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.core.internal.resources.ResourceException: Resource '/rewrw/diagrams/rewrw.xmi' does not exist. at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:216) at org.eclipse.graphiti.ui.editor.DiagramEditorInput.getEObject(DiagramEditorInput.java:674) at org.eclipse.graphiti.ui.editor.DiagramEditorInput.setEditorEditingDomain(DiagramEditorInput.java:569) at org.eclipse.graphiti.ui.editor.DiagramEditorInput.<init>(DiagramEditorInput.java:188) at org.eclipse.graphiti.ui.editor.DiagramEditorFactory.createElement(DiagramEditorFactory.java:205) at org.eclipse.ui.internal.NavigationHistoryEditorInfo.restoreEditor(NavigationHistoryEditorInfo.java:79) at org.eclipse.ui.internal.NavigationHistory.addEntry(NavigationHistory.java:371) at org.eclipse.ui.internal.NavigationHistory.access$10(NavigationHistory.java:355) at org.eclipse.ui.internal.NavigationHistory$2.run(NavigationHistory.java:202) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) ... 23 more Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/rewrw/diagrams/rewrw.xmi' does not exist. at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:327) at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:201) at org.eclipse.core.internal.resources.File.getContents(File.java:291) at org.eclipse.core.internal.resources.File.getContents(File.java:282) at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl$WorkbenchHelper.createPlatformResourceInputStream(PlatformResourceURIHandlerImpl.java:208) at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:452) at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:350) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1257) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:255) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:270) ... 35 more
Created attachment 195576 [details] Avoid deadlock I wasn't able to reproduce the issue, but I suppose that this exception is logged because the project is closed before the editor and the diagram.xmi file couldn't be found. So with this patch everything should work fine, because using it the editor is closed in the PRE_CLOSED phase of the "close resource action"...
Created attachment 195577 [details] Patch for junit tests
This patch has a little incompatibility with the patch in bug 345274. So I'll wait 'till the patch from 345274 is committed and then we'll change this one and propose it for PMC review.
Created attachment 196529 [details] Close JPA Editor before closing project
I tried the fix and I was able to reproduce the deadlock: 1. Create JPA project 2. Create one entity in it 3. Visualize entity in the JPA Editor 4. Open the entity in the java editor 5. Make sure that the diagram editor is on top 6. Try to close the project As a result the close operation will deadlock. NOTE: The operation won't deadlock if the diagram is empty or if the diagram editor is not on top. I guess it has something to do with the project update and the order of editor closing
*** Bug 346891 has been marked as a duplicate of this bug. ***
Created attachment 196568 [details] patch This one is good. I've just added some refinement ...
I'm not sure if it's stop-ship defect, but it certanly is close. Deadlock of the UI thread is an ugly thing. There is a workaround - close the diagram, before closing the project, but still - it's ugly and it has to be fixed ... The fix was tested manually. One of the existing tests had to be fixed (there is an additional patch for it) in order all to pass successfully. With this fix the editor is closed in the PRE_CLOSED phase of the "close resource action". I've reviewed the fix. The risk is moderate.
I'm ok with this for RC3 ... if Neil is. :) I just say that since does look like a fairly large, complicated change (from casual glance at patch) so would be good to get some extra eyes to review it. But, I agree its a bad enough problem to fix in RC3.
I just completed some testing. The problem seems to be resolved with the latest patch and I haven't noticed any obvious regressions. Not sure why I hadn't noticed before, but it seems that the first time you create a diagram and add some entities you are unable to save it. It seems this is not related to any recent patches as I can reproduce it in RC1 as well, so is a separate issue. I'll open a separate bug for that.
Committed and released - Hudson build job succeeded
.
Verified in Build I-3.3.0RC4-20110603221533 Verified you can close a project when the diagram is open, has an entity listed in the diagram, or is on top and the focus in the editor. See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.0_RC3