Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Merge Mode in EMFCompare + EGit(Question about the usage of the HEAD commit on EMF model comparisons)
Merge Mode in EMFCompare + EGit [message #1721638] Thu, 28 January 2016 20:42 Go to next message
Luis Mendes is currently offline Luis MendesFriend
Messages: 7
Registered: August 2015
Location: Denmark
Junior Member
Hello,

my name is Luis and I'm new to EMFCompare and it's integration with EGit.

I'm currently working with EMFCompare, and EGit, for the comparison (and conflict resolution) of EMF model instances of a domain specific meta-model (ecore). The files for comparison are serialized in XML format.

It all works fine until the point where EGit detects the existence of a conflict during a Git merge. In this use case , I launch the EMFCompare framework via Team >> Model Merge Tool (with EMFCompare), and after confirming that the merge mode is "Use HEAD of conflicting file" I get the following exception in the console:

!ENTRY org.eclipse.emf.compare.ide 4 0 2016-01-28 21:15:18.766
!MESSAGE Unable to load the resource with the uri platform:/resource/Collaboration_C2/Build_model_instance.xml from the storage Build_model_instance.xml
!STACK 0
org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Element type "features" must be followed by either attribute specifications, ">" or "/>".
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:195)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
at org.eclipse.emf.compare.ide.internal.utils.NotLoadingResourceSet.loadFromStorage(NotLoadingResourceSet.java:254)
at org.eclipse.emf.compare.ide.internal.utils.NotLoadingResourceSet.load(NotLoadingResourceSet.java:416)
at org.eclipse.emf.compare.ide.internal.utils.NotLoadingResourceSet.load(NotLoadingResourceSet.java:383)
at org.eclipse.emf.compare.ide.internal.utils.NotLoadingResourceSet.create(NotLoadingResourceSet.java:155)
at org.eclipse.emf.compare.ide.ui.internal.logical.ComparisonScopeBuilder.createScope(ComparisonScopeBuilder.java:494)
at org.eclipse.emf.compare.ide.ui.internal.logical.ComparisonScopeBuilder.create(ComparisonScopeBuilder.java:275)
at org.eclipse.emf.compare.ide.ui.internal.logical.EMFSynchronizationCompareAdapter.asCompareInput(EMFSynchronizationCompareAdapter.java:39)
at org.eclipse.emf.compare.egit.ui.internal.merge.ModelGitMergeEditorInput.prepareCompareInput(ModelGitMergeEditorInput.java:357)
at org.eclipse.emf.compare.egit.ui.internal.merge.ModelGitMergeEditorInput.prepareInput(ModelGitMergeEditorInput.java:198)
at org.eclipse.compare.CompareEditorInput.run(CompareEditorInput.java:484)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Caused by: org.xml.sax.SAXParseExceptionpublicId: platform:/resource/Collaboration_C2/Build_model_instance.xml; systemId: platform:/resource/Collaboration_C2/Build_model_instance.xml; lineNumber: 501; columnNumber: 1; Element type "features" must be followed by either attribute specifications, ">" or "/>".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.seekCloseOfStartTag(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
... 13 more


Despite the above exception, the EMFCompare UI is launched but the compared versions have an enormous amount of differences and missing elements, most likely caused by the aforementioned parsing exception. The only possible explanation I can come up with, although I'm not sure, is EMFCompare not considering/fetching the HEAD version but the worskpace version which has indeed been pre-merged by git and has th "<<<<<<<<" plus ">>>>>>" strings of characters on conflicting lines, in this case, of the model instance file. My questions at this point are:

1) Did any of you experienced such behavior? I'm expecting that when selecting the Merge mode "Use HEAD", EMFCompare would fetch the HEAD commit version of the conflicting file and not the workspace/pre-merged version.

2) Do you know of anything I can do to overcome this behavior ? Since I don't want to use the pre-merged version of EGit for the comparison.

3) If this is a misbehavior/bug how can I contribute in anyway ?

I'm using EMFCompare 3.2 with EGit 4.2 on an Eclipse Mars platform instance.

Thank you very much in advance for your time.

Best regards,
Luis Mendes
Re: Merge Mode in EMFCompare + EGit [message #1721741 is a reply to message #1721638] Fri, 29 January 2016 15:58 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

Some of our modifications to EGit so that it takes into account other mergers instead of considering everything as text are still pending, and the official release contributed to the eclipse repository thus don't include them.

We provide custom packages including all of our modifications for download. Take a look at the collaborative modeling initiative page for info on how to retrieve them. If you already have an eclipse installation with a lot of plugins, consider the "Updating your Eclipse installation" section to simply use an update site and install the necessary plugins. Otherwise, you might want to simply retrieve one of the ready-to-use packages.

Please keep us informed of your progress and tell us if it still doesn't work when using these.

Laurent Goubet
Obeo
Re: Merge Mode in EMFCompare + EGit [message #1721886 is a reply to message #1721741] Mon, 01 February 2016 10:21 Go to previous messageGo to next message
Luis Mendes is currently offline Luis MendesFriend
Messages: 7
Registered: August 2015
Location: Denmark
Junior Member
Hello Laurent,

thank you very much for your reply.

I've made some changes in my target platform setup in order to be sure to point to the latest integration builds of EMFCompare and EGit and I'm now quite certain that it was enough to follow the "Notes" section of Collaborative Modeling Initiative page and make sure the EMFCompare merger is the one executed for EGit merging operations (option "Recursive Model Merge Strategy" in Git >> Synchronize preferences ) and also the EGit option of Logical model use ("Allow models (e.g., java, EMF) to participate in synchronizations").

After making sure these options were in fact set, I had no exceptions taking place in launching EMFCompare on the conflicting statuses derived from EGit merging operations, and all the conflicting differences were correctly displayed in EMFCompare's UI. I also validated the EGit merging operation with non-conflicting differences and I saw no abnormal behavior in the merging of the two model instances.

Thank you once again.

Best regards,
Luis Mendes
Re: Merge Mode in EMFCompare + EGit [message #1722222 is a reply to message #1721886] Wed, 03 February 2016 13:42 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Thanks a lot for your reply Luis. Please keep us informed if you ever see bugs or problematic behavior with these too.

Laurent Goubet
Obeo
Previous Topic:Using EMF Compare to Compare models
Next Topic:EMFCompare's EGit Recursive model merger
Goto Forum:
  


Current Time: Fri Mar 29 12:20:34 GMT 2024

Powered by FUDForum. Page generated in 0.02558 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top