osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
36 stars 8 forks source link

Exception When Migrating to Virtual Plugin Contributions #924

Closed philip-alldredge closed 6 years ago

philip-alldredge commented 6 years ago

I received exceptions when trying to migrate to use the virtual plugin contributions. The exception was only visible in the console of the eclipse used to start OSATE. From the perspective of OSATE, the migration failed silently. Files were not removed. The PC is running Windows 10.

!ENTRY org.osate.xtext.aadl2.properties.ui 4 0 2017-10-18 11:03:42.763 !MESSAGE Could not delete 'Plugin_Resources' project. !STACK 0 java.lang.reflect.InvocationTargetException at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:131) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.earlyStartup(PropertiesUiStartup.java:78) at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:77) at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:53) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.Workbench$40.run(Workbench.java:2747) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) Caused by: org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources. at org.eclipse.core.internal.resources.Resource.delete(Resource.java:773) at org.eclipse.core.internal.resources.Resource.delete(Resource.java:725) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.lambda$6(PropertiesUiStartup.java:149) at com.google.common.collect.Iterables$4.lambda$forEach$0(Iterables.java:581) at com.google.common.collect.Iterables$4.lambda$forEach$0(Iterables.java:581) at com.google.common.collect.Iterables$5.lambda$forEach$0(Iterables.java:624) at java.lang.Iterable.forEach(Iterable.java:75) at com.google.common.collect.Iterables$5.forEach(Iterables.java:621) at com.google.common.collect.Iterables$4.forEach(Iterables.java:578) at com.google.common.collect.Iterables$4.forEach(Iterables.java:578) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.deleteUnmodifiedContributed(PropertiesUiStartup.java:154) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.access$1(PropertiesUiStartup.java:127) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup$1.execute(PropertiesUiStartup.java:61) at org.eclipse.ui.actions.WorkspaceModifyOperation.lambda$0(WorkspaceModifyOperation.java:107) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:128) ... 6 more Root exception: org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources. at org.eclipse.core.internal.resources.Resource.delete(Resource.java:773) at org.eclipse.core.internal.resources.Resource.delete(Resource.java:725) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.lambda$6(PropertiesUiStartup.java:149) at com.google.common.collect.Iterables$4.lambda$forEach$0(Iterables.java:581) at com.google.common.collect.Iterables$4.lambda$forEach$0(Iterables.java:581) at com.google.common.collect.Iterables$5.lambda$forEach$0(Iterables.java:624) at java.lang.Iterable.forEach(Iterable.java:75) at com.google.common.collect.Iterables$5.forEach(Iterables.java:621) at com.google.common.collect.Iterables$4.forEach(Iterables.java:578) at com.google.common.collect.Iterables$4.forEach(Iterables.java:578) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.deleteUnmodifiedContributed(PropertiesUiStartup.java:154) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.access$1(PropertiesUiStartup.java:127) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup$1.execute(PropertiesUiStartup.java:61) at org.eclipse.ui.actions.WorkspaceModifyOperation.lambda$0(WorkspaceModifyOperation.java:107) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:128) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.earlyStartup(PropertiesUiStartup.java:78) at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:77) at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:53) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.Workbench$40.run(Workbench.java:2747) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) Contains: Could not delete 'C:\Users\philip.alldredge\projects\AADL Graphical Editor\runtime-EclipseXtext\Plugin_Resources\ARINC429.aadl'. org.eclipse.core.runtime.CoreException: Problems encountered while deleting files. at org.eclipse.core.internal.filesystem.local.LocalFile.delete(LocalFile.java:139) at org.eclipse.core.internal.resources.ResourceTree.internalDeleteFile(ResourceTree.java:310) at org.eclipse.core.internal.resources.ResourceTree.standardDeleteFile(ResourceTree.java:796) at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1777) at org.eclipse.core.internal.resources.Resource.delete(Resource.java:760) at org.eclipse.core.internal.resources.Resource.delete(Resource.java:725) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.lambda$6(PropertiesUiStartup.java:149) at com.google.common.collect.Iterables$4.lambda$forEach$0(Iterables.java:581) at com.google.common.collect.Iterables$4.lambda$forEach$0(Iterables.java:581) at com.google.common.collect.Iterables$5.lambda$forEach$0(Iterables.java:624) at java.lang.Iterable.forEach(Iterable.java:75) at com.google.common.collect.Iterables$5.forEach(Iterables.java:621) at com.google.common.collect.Iterables$4.forEach(Iterables.java:578) at com.google.common.collect.Iterables$4.forEach(Iterables.java:578) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.deleteUnmodifiedContributed(PropertiesUiStartup.java:154) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.access$1(PropertiesUiStartup.java:127) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup$1.execute(PropertiesUiStartup.java:61) at org.eclipse.ui.actions.WorkspaceModifyOperation.lambda$0(WorkspaceModifyOperation.java:107) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:128) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.earlyStartup(PropertiesUiStartup.java:78) at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:77) at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:53) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.Workbench$40.run(Workbench.java:2747) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) Contains: Could not delete: C:\Users\philip.alldredge\projects\AADL Graphical Editor\runtime-EclipseXtext\Plugin_Resources\ARINC429.aadl. java.nio.file.FileSystemException: C:\Users\philip.alldredge\projects\AADL Graphical Editor\runtime-EclipseXtext\Plugin_Resources\ARINC429.aadl: The process cannot access the file because it is being used by another process.

at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108) at java.nio.file.Files.deleteIfExists(Files.java:1165) at org.eclipse.core.internal.filesystem.local.LocalFile.internalDelete(LocalFile.java:220) at org.eclipse.core.internal.filesystem.local.LocalFile.delete(LocalFile.java:137) at org.eclipse.core.internal.resources.ResourceTree.internalDeleteFile(ResourceTree.java:310) at org.eclipse.core.internal.resources.ResourceTree.standardDeleteFile(ResourceTree.java:796) at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1777) at org.eclipse.core.internal.resources.Resource.delete(Resource.java:760) at org.eclipse.core.internal.resources.Resource.delete(Resource.java:725) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.lambda$6(PropertiesUiStartup.java:149) at com.google.common.collect.Iterables$4.lambda$forEach$0(Iterables.java:581) at com.google.common.collect.Iterables$4.lambda$forEach$0(Iterables.java:581) at com.google.common.collect.Iterables$5.lambda$forEach$0(Iterables.java:624) at java.lang.Iterable.forEach(Iterable.java:75) at com.google.common.collect.Iterables$5.forEach(Iterables.java:621) at com.google.common.collect.Iterables$4.forEach(Iterables.java:578) at com.google.common.collect.Iterables$4.forEach(Iterables.java:578) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.deleteUnmodifiedContributed(PropertiesUiStartup.java:154) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.access$1(PropertiesUiStartup.java:127) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup$1.execute(PropertiesUiStartup.java:61) at org.eclipse.ui.actions.WorkspaceModifyOperation.lambda$0(WorkspaceModifyOperation.java:107) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:128) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.earlyStartup(PropertiesUiStartup.java:78) at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:77) at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:53) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.Workbench$40.run(Workbench.java:2747) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

I closed all projects and restarted Eclipse and I tried the migration again and received the following exception:

!ENTRY org.osate.xtext.aadl2.properties.ui 4 0 2017-10-18 11:07:15.543 !MESSAGE Could not delete 'Plugin_Resources' project. !STACK 0 java.lang.reflect.InvocationTargetException at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:131) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.earlyStartup(PropertiesUiStartup.java:78) at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:77) at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:53) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.Workbench$40.run(Workbench.java:2747) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) Caused by: org.eclipse.core.internal.resources.ResourceException: Project 'Plugin_Resources' is not open. at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:144) at org.eclipse.core.internal.resources.Container.members(Container.java:239) at org.eclipse.core.internal.resources.Container.members(Container.java:226) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.setModifiable(PropertiesUiStartup.java:121) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.access$0(PropertiesUiStartup.java:104) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup$1.execute(PropertiesUiStartup.java:60) at org.eclipse.ui.actions.WorkspaceModifyOperation.lambda$0(WorkspaceModifyOperation.java:107) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:128) ... 6 more Root exception: org.eclipse.core.internal.resources.ResourceException: Project 'Plugin_Resources' is not open. at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:144) at org.eclipse.core.internal.resources.Container.members(Container.java:239) at org.eclipse.core.internal.resources.Container.members(Container.java:226) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.setModifiable(PropertiesUiStartup.java:121) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.access$0(PropertiesUiStartup.java:104) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup$1.execute(PropertiesUiStartup.java:60) at org.eclipse.ui.actions.WorkspaceModifyOperation.lambda$0(WorkspaceModifyOperation.java:107) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:128) at org.osate.xtext.aadl2.properties.ui.PropertiesUiStartup.earlyStartup(PropertiesUiStartup.java:78) at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:77) at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:53) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.Workbench$40.run(Workbench.java:2747) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

Opening just the old Plugin_Resources project resulted in the first exception occurring again.

joeseibel commented 6 years ago

This does seem to be OS specific. I just tried it on Windows 10 and saw the same behavior. It works fine on Linux and MacOS. I seem to remember that I did test the migration when I developed it last year, but I was running Windows 7 back then. Lutz is going to test this on his Windows 7 installation.