Community
Participate
Working Groups
I created a RCP Application (Example RCP with additional PartStack) with one new bundle. This bundle contains a model fragment with one additional part. The fragment has the apply state "EMPTY" in the plugin.xml. First run works as expected. Now I close this new Part and restart the client. Part is reopend!!! It gets even more cracy if I move the part into another partStack! After restart the moved part is still there but also the part at it's initial place appears. If now I do nothing but restarting the Client throws an Exception: What am I doing wrong? org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'testappfragment.placeholder.0=org.eclipse.e4.ui.model.application.ui.advanced.impl.PlaceholderImpl@5ae76500 (tags: null, contributorURI: platform:/plugin/TestAppFragment) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (closeable: false)' is not legal. (file:/C:/DEVELOPMENT/tps-client-product-feature-client3/workspaces/runtime-TestApp.product/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi, -1, -1) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406) at org.eclipse.e4.ui.internal.workbench.ResourceHandler.getResource(ResourceHandler.java:282) at org.eclipse.e4.ui.internal.workbench.ResourceHandler.loadResource(ResourceHandler.java:258) at org.eclipse.e4.ui.internal.workbench.ResourceHandler.loadMostRecentModel(ResourceHandler.java:165) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:378) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:253) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:149) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:656) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:592) at org.eclipse.equinox.launcher.Main.run(Main.java:1498) at org.eclipse.equinox.launcher.Main.main(Main.java:1471) Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'testappfragment.placeholder.0=org.eclipse.e4.ui.model.application.ui.advanced.impl.PlaceholderImpl@5ae76500 (tags: null, contributorURI: platform:/plugin/TestAppFragment) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (closeable: false)' is not legal. (file:/C:/DEVELOPMENT/tps-client-product-feature-client3/workspaces/runtime-TestApp.product/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi, -1, -1) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2715) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardReferences(XMLHandler.java:1193) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHandler.java:1282) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:745) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327) at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1563) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1342) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274) ... 20 more Caused by: java.lang.IllegalArgumentException: The selected element testappfragment.placeholder.0=org.eclipse.e4.ui.model.application.ui.advanced.impl.PlaceholderImpl@5ae76500 (tags: null, contributorURI: platform:/plugin/TestAppFragment) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (closeable: false) is not a child of this container at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:161) at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.eSet(ElementContainerImpl.java:237) at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1071) at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1204) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2710) ... 36 more !ENTRY org.eclipse.e4.ui.workbench 4 0 2019-04-26 16:25:21.537 !MESSAGE The persisted application model has no top-level window. Reinitializing with the default application model. !STACK 0 java.lang.Exception at org.eclipse.e4.ui.internal.workbench.ResourceHandler.loadMostRecentModel(ResourceHandler.java:170) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:378) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:253) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:149) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:656) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:592) at org.eclipse.equinox.launcher.Main.run(Main.java:1498) at org.eclipse.equinox.launcher.Main.main(Main.java:1471)
Can you attach an example or provide exact steps?
Created attachment 278423 [details] Test Application Test Application with one Fragment Bundle.
I also tried the apply="notexists" which I would like to use for my fragments in case of updates and additional UI Elements. But with this setting somehow the "org.eclipse.e4.ui.internal.workbench.ModelAssembler" has different IDs to check against. It seams that the ID Map contains the IDs from the defined Model in the xmi files and the stored model has different IDs where no ui element is found in the Map of the Assembler.
Created attachment 278441 [details] Test Application (with correct Product)
I can't reproduce this using 4.12 M1: https://download.eclipse.org/eclipse/downloads/drops4/S-4.12M1-201904110625/ If you can reproduce with 4.12 M1 or newer, please reopen and provide more detailed steps.
Created attachment 278460 [details] Screenshot 1
Created attachment 278461 [details] Screenshot 2
Created attachment 278462 [details] Screenshot 3
Created attachment 278463 [details] Screenshot 4
Created attachment 278464 [details] Screenshot 5
I still get the same Problem with 4.12. Here some more info and steps to reproduce: <extension id="TestAppFragment.fragment" point="org.eclipse.e4.workbench.model"> <fragment apply="" uri="fragment.e4xmi"> </fragment> </extension> 1. Launch TestApp with "Clear" Workspace Data [Screenshot 1] [Screenshot 2] 2. Move part "Hallo Fragment" to top PartStack [Screenshot 3] 3. Close App 4. Launch TestApp with "Don't clear" Workspace Data [Screenshot 4] [Screenshot 5] 5. Close and Launch TestApp again App throws the Exception and App startet with default Application Model. Tried different apply model: "apply=EMPTY": behaviour like described above "apply=always": behaviour like described above "apply=notexists": No Exception but duplicate part "apply=initial": Works as expected
OK, I can reproduce it with the Hallo Fragment using https://download.eclipse.org/eclipse/downloads/drops4/I20190501-1800/ and a new workspace, however, I do not get any exceptions.
(In reply to Dani Megert from comment #12) > OK, I can reproduce it with the Hallo Fragment using > https://download.eclipse.org/eclipse/downloads/drops4/I20190501-1800/ and a > new workspace, however, I do not get any exceptions. In the test application from the attachment the apply policy is "notexists". Switch that to either "EMPTY" or "always"
(In reply to Stefan Nöbauer from comment #3) > I also tried the apply="notexists" which I would like to use for my > fragments in case of updates and additional UI Elements. > > But with this setting somehow the > "org.eclipse.e4.ui.internal.workbench.ModelAssembler" has different IDs to > check against. It seams that the ID Map contains the IDs from the defined > Model in the xmi files and the stored model has different IDs where no ui > element is found in the Map of the Assembler. The check about the IDs is in the org.eclipse.e4.ui.internal.workbench.ModelAssembler at line 342. if (checkExist && applicationResource.getIDToEObjectMap().containsKey(r.getID(o))) { continue; } It seems that new IDs will be generated on loading the persisted model. Therefore the newly generated IDs are not equals to the ones in the fragment.e4xmi Why are new IDs generated?
New Gerrit change created: https://git.eclipse.org/r/142676
Thank you for the contribution! Did you have a look at BR 487748? I think it is a duplicate and basically reports that "notexist" is not working at all. the current documentation of "notexist" says "only if the given element does not exist already in the model", so that is already what you want. So I would suggest to nor introduce another flag as you did, but fix the "notexist" instead. To do this, I suggest that you keep the line: "fragment.getElements().removeAll(existingElements);" But basically remove everything else related to "notInApp". Further I would then adapt your tests. please note that there is a test for 487748 called "testFragments_existingXMIID_checkExists()" that is currently ignore due to this bug. It would be great, if you could "unignore" it to check whether the other bug is fixed then, too. Thank you again for reporting and contributing!
Gerrit change https://git.eclipse.org/r/142676 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=df1b1868f23e06b557f2804c840538f9a2d16bcb
(In reply to Eclipse Genie from comment #17) > Gerrit change https://git.eclipse.org/r/142676 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=df1b1868f23e06b557f2804c840538f9a2d16bcb Are you sure? Jonas, we are at RC1 time and can't merge anything without approval.
New Gerrit change created: https://git.eclipse.org/r/143029
Gerrit change https://git.eclipse.org/r/143029 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=235f6c4cc79b51d741409c440e3d65f01747a0e2
I am sorry but I had to revert this as it violates the endgame rules. For details see https://www.eclipse.org/eclipse/development/plans/freeze_plan_4_12.php, especially: "All fixes submitted must have a project lead or PMC vote on the bug report," You can either look for approval or move it to 4.13. Having said that, thanks very much for your contribution.
Yeah, I am sorry for that. I would vote for moving to 4.13, is this OK for you Stefan?
Hi, We would need this fix very urgent for our next release of our product in August. Is there a change to get the PMC vote for the 4.12. Release? I would appreciate that a lot! Best Stefan
(In reply to Stefan Nöbauer from comment #23) > Hi, > We would need this fix very urgent for our next release of our product in > August. Is there a change to get the PMC vote for the 4.12. Release? I would > appreciate that a lot! > > Best > Stefan It is very late to make such a change in RC2 and there's always room for regressions. I don't know that code well enough, so, I won't -1 if another PMC member or project co-lead approves it. I think Lars is most qualified here as he made several changes to that class in the past.
(In reply to Dani Megert from comment #24) > (In reply to Stefan Nöbauer from comment #23) > > Hi, > > We would need this fix very urgent for our next release of our product in > > August. Is there a change to get the PMC vote for the 4.12. Release? I would > > appreciate that a lot! > > > > Best > > Stefan > It is very late to make such a change in RC2 and there's always room for > regressions. I don't know that code well enough, so, I won't -1 if another > PMC member or project co-lead approves it. I think Lars is most qualified > here as he made several changes to that class in the past. I can understand that but IMHO this fix is very separated to a "notexists" feature that is broken anyways. Lars what di you think?
To me the change looks ok but I'm not sure we should break our rules and bring in stuff so late. BTW there's a work around available by replacing the resource loading with a patched version (we had done this in efxclipse in the past while waiting for upstream fixes)
Stefan, this came really too late for 4.12. I suggest to register a custom resource handler to solve this. We can review/merge it early 4.13
Bug 487748 duplicates Bug 440030
(In reply to Jonas Helming from comment #22) > Yeah, I am sorry for that. I would vote for moving to 4.13, is this OK for > you Stefan? Jonas, 4.13 is open, please merge again if the patch is still OK for you.
New Gerrit change created: https://git.eclipse.org/r/143714
(In reply to Eclipse Genie from comment #30) > New Gerrit change created: https://git.eclipse.org/r/143714 Looking at this gerrit and the gerrit attached to Bug 440030, https://git.eclipse.org/r/34817, this bug is a duplicate of Bug 440030.
Created attachment 278902 [details] An example application to create a partial merge Make sure, you do not clear the workspace nor turn on -clearpersistedState Launch the application, open toolbar item should be merged from the fragment and work. Close the application Open workspacelocation/runtime-testFragment.product/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi in a text editor delete the toolbar item "testFragment.handleditem.trimbar.top.open" simulating that a former contribution is removed and therefore does not exist anymore. restart the application. The toolbar item should be merged again but the reference should point to the command which has been merged before. Toolbar action should work as before then.
(In reply to Jonas Helming from comment #32) > Created attachment 278902 [details] > An example application to create a partial merge > > Make sure, you do not clear the workspace nor turn on -clearpersistedState > > Launch the application, open toolbar item should be merged from the fragment > and work. > > Close the application > > Open > workspacelocation/runtime-testFragment.product/.metadata/.plugins/org. > eclipse.e4.workbench/workbench.xmi > in a text editor > > delete the toolbar item "testFragment.handleditem.trimbar.top.open" > simulating that a former contribution is removed and therefore does not > exist anymore. > > restart the application. The toolbar item should be merged again but the > reference should point to the command which has been merged before. Toolbar > action should work as before then. Thanks Jonas, I try to add a test that is covering this usecase.
Without thinking it completly through, I like the idea that Rolf brought up to use the "import" meachnism for this. Imports are created, if an element in the fragment points to an element that already exists in the application model. In our use case, elements in the fragment that already exists in the application model are a similar case. So preparing the fragment in a way that element which will not be merged are converted to imports seems like a pragmatic approach. You might want to look at the "Extract into fragment" action of the editor, because it calculates the imports for elements when extracted. Again, I haven't thought this completly through, just wanted to drop some thoughts.
Hi so i added a new Test to simulate the partly merge. I would like to push a new Change as I don't like the Revert of a Revert!
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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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. -- The automated Eclipse Genie.