Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » RE: Merge EMF Models
RE: Merge EMF Models [message #115181] Thu, 20 March 2008 11:16 Go to next message
Eclipse UserFriend
Originally posted by: mmelia.computing.dcu.ie

Hi all,

I am looking for something to merge two ecore models which are defined
according to the same metamodel - does anyone have an idea. I would
ideally like to use an ant script for the merge.

I have been looking at EMF Compare but cant access the developer guide,
maybe someone can tell me if this would suit my needs - possibly point me
to a tutorial.

Thanks for your help,
Mark
Re: Merge EMF Models [message #115195 is a reply to message #115181] Thu, 20 March 2008 11:56 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090309010109040405010705
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Mark,

EMF Compare would meet your needs if what you're looking for is to
compare your two models and have a way to merge the differences between
them. For example, if you wish to merge differences between model1 (old)
and model2 (new) from left to right (undo differences in the new model),
you can use

// Matches elements of the two models
final MatchModel match = MatchService.doResourceMatch(model1, model2,
Collections.emptyMap());
// Detects differences
final DiffModel diff = DiffService.doDiff(match);
// Merges all differences from model1 to model2
MergeService.merge(diff.getOwnedElements());

Cheers,
Laurent

Mark Melia a
Re: Merge EMF Models [message #115207 is a reply to message #115195] Thu, 20 March 2008 12:00 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010403090604040705030808
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Sorry, clicked "send" before actually answering all questions ;).

About documentation on EMF Compare... Well we currently have no real
documentation other than the examples on eclipse CVS, the home page
http://www.eclipse.org/modeling/emft/?project=compare on Eclipse and the
wiki at http://wiki.eclipse.org/index.php/EMF_Compare .

Laurent

laurent Goubet a
Re: Merge EMF Models [message #115591 is a reply to message #115207] Mon, 24 March 2008 22:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mmelia.computing.dcu.ie

Hi Laurent,

Thanks for your reply, I tried to put what you said into action - the code
is below. I still have a problem, I get a build error which states that
org.eclipse.core.runtime.IPath is required for creating model1, but when I
have a look in my library files, there doesnt seem to be an IPath class in
org.eclipse.core.runtime.

I am using Eclipse 3.4, and installed EMF compare through the software
updates mechinism, EMF Compare version is 0.8.0, can you see where I am
going wrong?

Thanks again,
Mark

CODE

package test;

import java.io.File;
import java.util.Collections;

import org.eclipse.emf.compare.diff.merge.service.MergeService;
import org.eclipse.emf.compare.diff.metamodel.DiffModel;
import org.eclipse.emf.compare.diff.service.DiffService;
import org.eclipse.emf.compare.match.metamodel.MatchModel;
import org.eclipse.emf.compare.match.service.MatchService;
import org.eclipse.emf.compare.util.ModelUtils;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.common.util.URI;

public class Test {

/**
* @param args
*/
public static void main(String[] args) {
try
{
final ResourceSet modelResourceSet = new ResourceSetImpl();

Resource model1 =
ModelUtils.load(URI.createFileURI("/home/mark/workspace/ATestProject/mikaelHigh.ecore "),
modelResourceSet).eResource();
Resource model2 = ModelUtils.load(new
java.io.File("/home/mark/workspace/ATestProject/mikaelLow.ecore "),
modelResourceSet).eResource();
// Matches elements of the two models
final MatchModel match = MatchService.doResourceMatch(model1,
model2, null);
// Detects differences
final DiffModel diff = DiffService.doDiff(match);
// Merges all differences from model1 to model2
MergeService.merge(diff.getOwnedElements(), true);
}
catch (Exception exception)
{
exception.printStackTrace();

}


}

}



laurent Goubet wrote:

> Sorry, clicked "send" before actually answering all questions ;).

> About documentation on EMF Compare... Well we currently have no real
> documentation other than the examples on eclipse CVS, the home page
> http://www.eclipse.org/modeling/emft/?project=compare on Eclipse and the
> wiki at http://wiki.eclipse.org/index.php/EMF_Compare .

> Laurent

> laurent Goubet a écrit :
>> Mark,
>>
>> EMF Compare would meet your needs if what you're looking for is to
>> compare your two models and have a way to merge the differences between
>> them. For example, if you wish to merge differences between model1 (old)
>> and model2 (new) from left to right (undo differences in the new model),
>> you can use
>>
>> // Matches elements of the two models
>> final MatchModel match = MatchService.doResourceMatch(model1, model2,
>> Collections.emptyMap());
>> // Detects differences
>> final DiffModel diff = DiffService.doDiff(match);
>> // Merges all differences from model1 to model2
>> MergeService.merge(diff.getOwnedElements());
>>
>> Cheers,
>> Laurent
>>
>> Mark Melia a écrit :
>>> Hi all,
>>>
>>> I am looking for something to merge two ecore models which are defined
>>> according to the same metamodel - does anyone have an idea. I would
>>> ideally like to use an ant script for the merge.
>>>
>>> I have been looking at EMF Compare but cant access the developer
>>> guide, maybe someone can tell me if this would suit my needs -
>>> possibly point me to a tutorial.
>>>
>>> Thanks for your help,
>>> Mark
>>>
>>
Re: Merge EMF Models [message #115641 is a reply to message #115591] Tue, 25 March 2008 12:07 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080000020706080903060400
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Mark,

Yup, org.eclipse.core.runtime is located in plug-in
org.eclipse.equinox.common. You need to add that one in your
dependencies as well.

Who said qualified names are unambiguous? :D

Cheers
Laurent Goubet
Obeo

Mark Melia a
Merge EMF Models [message #115654 is a reply to message #115641] Tue, 25 March 2008 12:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arist102.hotmail.com

Hey Laurent,Mark,
I need your help too. I am a rookie in eclipse and I need also to merge 2
EMF models according to the same metamodel.I already installed EMF Compare
but I donŽt know further.Please can you help me?
thx Ari
Re: Merge EMF Models [message #115668 is a reply to message #115641] Tue, 25 March 2008 12:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mmelia.computing.dcu.ie

Laurent,

Thanks again for your help. I imported the plugin jars:
org.eclipse.equinox.common_3.4.0v20080201.jar, but I still have the same
problem - I looked through this package and could not find the package the
IFile class should be in.

I also tried to get the code working by passing ModelUtils a File rather
than a URI, but this gives me the following runtime error - do you have
any ideas? Am I using the ModelUtils.load method with a java.io.File
parameter correctly?

Thanks for your help,
Mark

Exception in thread "main" java.lang.ExceptionInInitializerError
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:91)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:194)
at
org.eclipse.emf.ecore.xmi.impl.XMIHelperImpl.<init>(XMIHelperImpl.java:32)
at
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLHelp er(XMIResourceImpl.java:53)
at
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLLoad (XMIResourceImpl.java:59)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:166)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1210)
at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :333)
at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :217)
at test.Test.main(Test.java:29)
Caused by: java.lang.SecurityException: SHA1 digest error for
org/eclipse/emf/ecore/util/ECrossReferenceEList.class
at
sun.security.util.ManifestEntryVerifier.verify(ManifestEntry Verifier.java:194)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:201)
at java.util.jar.JarVerifier.update(JarVerifier.java:188)
laurent Goubet wrote:

> Mark,

> Yup, org.eclipse.core.runtime is located in plug-in
> org.eclipse.equinox.common. You need to add that one in your
> dependencies as well.

> Who said qualified names are unambiguous? :D

> Cheers
> Laurent Goubet
> Obeo

> Mark Melia a écrit :
>> Hi Laurent,
>>
>> Thanks for your reply, I tried to put what you said into action - the
>> code is below. I still have a problem, I get a build error which states
>> that org.eclipse.core.runtime.IPath is required for creating model1,
>> but when I have a look in my library files, there doesnt seem to be an
>> IPath class in org.eclipse.core.runtime.
>>
>> I am using Eclipse 3.4, and installed EMF compare through the software
>> updates mechinism, EMF Compare version is 0.8.0, can you see where I am
>> going wrong?
>>
>> Thanks again,
>> Mark
>>
>> CODE
>>
>> package test;
>>
>> import java.io.File;
>> import java.util.Collections;
>>
>> import org.eclipse.emf.compare.diff.merge.service.MergeService;
>> import org.eclipse.emf.compare.diff.metamodel.DiffModel;
>> import org.eclipse.emf.compare.diff.service.DiffService;
>> import org.eclipse.emf.compare.match.metamodel.MatchModel;
>> import org.eclipse.emf.compare.match.service.MatchService;
>> import org.eclipse.emf.compare.util.ModelUtils;
>> import org.eclipse.emf.ecore.resource.Resource;
>> import org.eclipse.emf.ecore.resource.ResourceSet;
>> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
>> import org.eclipse.emf.common.util.URI;
>>
>> public class Test {
>>
>> /**
>> * @param args
>> */
>> public static void main(String[] args) {
>> try {
>> final ResourceSet modelResourceSet = new ResourceSetImpl();
>>
>> Resource model1 =
>>
ModelUtils.load(URI.createFileURI("/home/mark/workspace/ATestProject/mikaelHigh.ecore "),
>> modelResourceSet).eResource();
>> Resource model2 = ModelUtils.load(new
>> java.io.File("/home/mark/workspace/ATestProject/mikaelLow.ecore "),
>> modelResourceSet).eResource();
>> // Matches elements of the two models
>> final MatchModel match = MatchService.doResourceMatch(model1,
>> model2, null);
>> // Detects differences
>> final DiffModel diff = DiffService.doDiff(match);
>> // Merges all differences from model1 to model2
>> MergeService.merge(diff.getOwnedElements(), true);
>> } catch (Exception exception) {
>> exception.printStackTrace();
>>
>> }
>>
>> }
>>
>> }
>>
>>
>>
>> laurent Goubet wrote:
>>
>>> Sorry, clicked "send" before actually answering all questions ;).
>>
>>> About documentation on EMF Compare... Well we currently have no real
>>> documentation other than the examples on eclipse CVS, the home page
>>> http://www.eclipse.org/modeling/emft/?project=compare on Eclipse and
>>> the wiki at http://wiki.eclipse.org/index.php/EMF_Compare .
>>
>>> Laurent
>>
>>> laurent Goubet a écrit :
>>>> Mark,
>>>>
>>>> EMF Compare would meet your needs if what you're looking for is to
>>>> compare your two models and have a way to merge the differences
>>>> between them. For example, if you wish to merge differences between
>>>> model1 (old) and model2 (new) from left to right (undo differences in
>>>> the new model), you can use
>>>>
>>>> // Matches elements of the two models
>>>> final MatchModel match = MatchService.doResourceMatch(model1, model2,
>>>> Collections.emptyMap());
>>>> // Detects differences
>>>> final DiffModel diff = DiffService.doDiff(match);
>>>> // Merges all differences from model1 to model2
>>>> MergeService.merge(diff.getOwnedElements());
>>>>
>>>> Cheers,
>>>> Laurent
>>>>
>>>> Mark Melia a écrit :
>>>>> Hi all,
>>>>>
>>>>> I am looking for something to merge two ecore models which are
>>>>> defined according to the same metamodel - does anyone have an idea.
>>>>> I would ideally like to use an ant script for the merge.
>>>>>
>>>>> I have been looking at EMF Compare but cant access the developer
>>>>> guide, maybe someone can tell me if this would suit my needs -
>>>>> possibly point me to a tutorial.
>>>>>
>>>>> Thanks for your help,
>>>>> Mark
>>>>>
>>>>
>>
>>
Re: Merge EMF Models [message #115681 is a reply to message #115654] Tue, 25 March 2008 13:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mmelia.computing.dcu.ie

Hi Ari,

I am doing exactly what you are doing, so hopefully between the two of us,
we will get EMF compare working. At the moment I am working with Laurent
to get a simple example working, you can see my code in a previous post. I
am still having some trouble with this, as you can also see from my posts.

I have also found some of the code used by Laurent and his team usful in
the eclipse dev site
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org .eclipse.emf.compare/plugins/org.eclipse.emf.compare.ui/src/ org/eclipse/emf/compare/?root=Modeling_Project

Mark

Ari wrote:

> Hey Laurent,Mark,
> I need your help too. I am a rookie in eclipse and I need also to merge 2
> EMF models according to the same metamodel.I already installed EMF Compare
> but I donŽt know further.Please can you help me?
> thx Ari
Re: Merge EMF Models [message #115726 is a reply to message #115668] Wed, 26 March 2008 07:50 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040804010601030507010401
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Mark,

You need to resolve all dependencies before actually running the code.
As said earlier, org.eclipse.core.runtime.IPath is located in
org.eclipse.equinox.common, which you seem to have imported
successfully. As for IFile, it is located in org.eclipse.core.resources.

If you ever need to find the plugin a given class belongs to, use the
eclipse menu "navigate => open type" (ctrl+shift+T) then in the package
explorer, click on the icon with two arrows "Link with editor". This
should show you the .class file of the class you're seeking. From there,
simply look at the name of the jar this file is in.

Cheers,
Laurent Goubet
Obeo

Mark Melia a
Re: Merge EMF Models [message #115739 is a reply to message #115681] Wed, 26 March 2008 07:59 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000808080808070203010507
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Ari,

If you don't give us any more information, it might be difficult to help
you out ;). Here's a somewhat generic answer :

How do you wish to compare/merge your models? 1) Directly from eclipse
(GUI)? Or 2) programmatically?

If 1), you simply have to select your two models in eclipse's package
explorer, right-click, then select "compare with => each other". The
comparison result shows up (might take a while depending on your models'
size) and you simply have to select the action "copy all changes from
left(right) to right(left)".

If 2), you might be interested in reading this whole thread, then asking
us what you do not understand.

Cheers,
Laurent Goubet
Obeo

Mark Melia a
Re: Merge EMF Models [message #115832 is a reply to message #115726] Wed, 26 March 2008 13:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mmelia.computing.dcu.ie

Hi Laurent,

I dont think the problem is about the dependencies, as the error is being
caused by
Caused by: java.lang.SecurityException: SHA1 digest error for
>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
and the exception points to a line in the XMLHelperImpl.java (91) that my
eclipse says doesnt exist??

I think I dont have the right combination of plugins that the EMF compare
jars were originally compiled with, but i did download the dependencies
from the site - they are as follows:
emft-compare-SDK-incubation-I200803130951
emf-sdo-xsd-SDK-I200803041800
eclipse-SDK-3.4M5-linux-gtk
JDK1.5.0_15

can you see any problems with this? Do you think I am correct in my
diagnosis of the problem? Any thoughts?

Thanks again for your time on this.
Mark

laurent Goubet wrote:

> Mark,

> You need to resolve all dependencies before actually running the code.
> As said earlier, org.eclipse.core.runtime.IPath is located in
> org.eclipse.equinox.common, which you seem to have imported
> successfully. As for IFile, it is located in org.eclipse.core.resources.

> If you ever need to find the plugin a given class belongs to, use the
> eclipse menu "navigate => open type" (ctrl+shift+T) then in the package
> explorer, click on the icon with two arrows "Link with editor". This
> should show you the .class file of the class you're seeking. From there,
> simply look at the name of the jar this file is in.

> Cheers,
> Laurent Goubet
> Obeo

> Mark Melia a écrit :
>> Laurent,
>>
>> Thanks again for your help. I imported the plugin jars:
>> org.eclipse.equinox.common_3.4.0v20080201.jar, but I still have the same
>> problem - I looked through this package and could not find the package
>> the IFile class should be in.
>> I also tried to get the code working by passing ModelUtils a File rather
>> than a URI, but this gives me the following runtime error - do you have
>> any ideas? Am I using the ModelUtils.load method with a java.io.File
>> parameter correctly?
>>
>> Thanks for your help,
>> Mark
>>
>> Exception in thread "main" java.lang.ExceptionInInitializerError
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:91)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:194)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMIHelperImpl.<init>(XMIHelperImpl.java:32)
>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLHelp er(XMIResourceImpl.java:53)
>>
>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLLoad (XMIResourceImpl.java:59)
>>
>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:166)
>>
>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
>>
>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1210)
>>
>> at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :333)
>> at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :217)
>> at test.Test.main(Test.java:29)
>> Caused by: java.lang.SecurityException: SHA1 digest error for
>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
>> at
>>
sun.security.util.ManifestEntryVerifier.verify(ManifestEntry Verifier.java:194)
>>
>> at java.util.jar.JarVerifier.processEntry(JarVerifier.java:201)
>> at java.util.jar.JarVerifier.update(JarVerifier.java:188)
>> laurent Goubet wrote:
>>
>>> Mark,
>>
>>> Yup, org.eclipse.core.runtime is located in plug-in
>>> org.eclipse.equinox.common. You need to add that one in your
>>> dependencies as well.
>>
>>> Who said qualified names are unambiguous? :D
>>
>>> Cheers
>>> Laurent Goubet
>>> Obeo
>>
>>> Mark Melia a écrit :
>>>> Hi Laurent,
>>>>
>>>> Thanks for your reply, I tried to put what you said into action - the
>>>> code is below. I still have a problem, I get a build error which
>>>> states that org.eclipse.core.runtime.IPath is required for creating
>>>> model1, but when I have a look in my library files, there doesnt seem
>>>> to be an IPath class in org.eclipse.core.runtime.
>>>>
>>>> I am using Eclipse 3.4, and installed EMF compare through the
>>>> software updates mechinism, EMF Compare version is 0.8.0, can you see
>>>> where I am going wrong?
>>>>
>>>> Thanks again,
>>>> Mark
>>>>
>>>> CODE
>>>>
>>>> package test;
>>>>
>>>> import java.io.File;
>>>> import java.util.Collections;
>>>>
>>>> import org.eclipse.emf.compare.diff.merge.service.MergeService;
>>>> import org.eclipse.emf.compare.diff.metamodel.DiffModel;
>>>> import org.eclipse.emf.compare.diff.service.DiffService;
>>>> import org.eclipse.emf.compare.match.metamodel.MatchModel;
>>>> import org.eclipse.emf.compare.match.service.MatchService;
>>>> import org.eclipse.emf.compare.util.ModelUtils;
>>>> import org.eclipse.emf.ecore.resource.Resource;
>>>> import org.eclipse.emf.ecore.resource.ResourceSet;
>>>> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
>>>> import org.eclipse.emf.common.util.URI;
>>>>
>>>> public class Test {
>>>>
>>>> /**
>>>> * @param args
>>>> */
>>>> public static void main(String[] args) {
>>>> try {
>>>> final ResourceSet modelResourceSet = new ResourceSetImpl();
>>>> Resource model1 =
>>
ModelUtils.load(URI.createFileURI("/home/mark/workspace/ATestProject/mikaelHigh.ecore "),
>>
>>>> modelResourceSet).eResource();
>>>> Resource model2 = ModelUtils.load(new
>>>> java.io.File("/home/mark/workspace/ATestProject/mikaelLow.ecore "),
>>>> modelResourceSet).eResource();
>>>> // Matches elements of the two models
>>>> final MatchModel match =
>>>> MatchService.doResourceMatch(model1, model2, null);
>>>> // Detects differences
>>>> final DiffModel diff = DiffService.doDiff(match);
>>>> // Merges all differences from model1 to model2
>>>> MergeService.merge(diff.getOwnedElements(), true);
>>>> } catch (Exception exception) {
>>>> exception.printStackTrace();
>>>> }
>>>> }
>>>>
>>>> }
>>>>
>>>>
>>>>
>>>> laurent Goubet wrote:
>>>>
>>>>> Sorry, clicked "send" before actually answering all questions ;).
>>>>
>>>>> About documentation on EMF Compare... Well we currently have no real
>>>>> documentation other than the examples on eclipse CVS, the home page
>>>>> http://www.eclipse.org/modeling/emft/?project=compare on Eclipse and
>>>>> the wiki at http://wiki.eclipse.org/index.php/EMF_Compare .
>>>>
>>>>> Laurent
>>>>
>>>>> laurent Goubet a écrit :
>>>>>> Mark,
>>>>>>
>>>>>> EMF Compare would meet your needs if what you're looking for is to
>>>>>> compare your two models and have a way to merge the differences
>>>>>> between them. For example, if you wish to merge differences between
>>>>>> model1 (old) and model2 (new) from left to right (undo differences
>>>>>> in the new model), you can use
>>>>>>
>>>>>> // Matches elements of the two models
>>>>>> final MatchModel match = MatchService.doResourceMatch(model1,
>>>>>> model2, Collections.emptyMap());
>>>>>> // Detects differences
>>>>>> final DiffModel diff = DiffService.doDiff(match);
>>>>>> // Merges all differences from model1 to model2
>>>>>> MergeService.merge(diff.getOwnedElements());
>>>>>>
>>>>>> Cheers,
>>>>>> Laurent
>>>>>>
>>>>>> Mark Melia a écrit :
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I am looking for something to merge two ecore models which are
>>>>>>> defined according to the same metamodel - does anyone have an
>>>>>>> idea. I would ideally like to use an ant script for the merge.
>>>>>>>
>>>>>>> I have been looking at EMF Compare but cant access the developer
>>>>>>> guide, maybe someone can tell me if this would suit my needs -
>>>>>>> possibly point me to a tutorial.
>>>>>>>
>>>>>>> Thanks for your help,
>>>>>>> Mark
>>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
Re: Merge EMF Models [message #115858 is a reply to message #115832] Wed, 26 March 2008 14:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Mark,

This looks to be a problem purely with the JVM not recognizing the
signed jar as having been properly signed, though I'm sure the jar is
properly signed. I think there might be a way to tell the JVM not to
verify signatures as a workaround, but I don't recall the flag for
that. I also seem to recall some issue with specific versions of
certain JDKs having a bug related to this...


Mark Melia wrote:
> Hi Laurent,
>
> I dont think the problem is about the dependencies, as the error is
> being caused by Caused by: java.lang.SecurityException: SHA1 digest
> error for
>>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
> and the exception points to a line in the XMLHelperImpl.java (91) that
> my eclipse says doesnt exist??
>
> I think I dont have the right combination of plugins that the EMF
> compare jars were originally compiled with, but i did download the
> dependencies from the site - they are as follows:
> emft-compare-SDK-incubation-I200803130951
> emf-sdo-xsd-SDK-I200803041800
> eclipse-SDK-3.4M5-linux-gtk
> JDK1.5.0_15
>
> can you see any problems with this? Do you think I am correct in my
> diagnosis of the problem? Any thoughts?
>
> Thanks again for your time on this.
> Mark
>
> laurent Goubet wrote:
>
>> Mark,
>
>> You need to resolve all dependencies before actually running the
>> code. As said earlier, org.eclipse.core.runtime.IPath is located in
>> org.eclipse.equinox.common, which you seem to have imported
>> successfully. As for IFile, it is located in org.eclipse.core.resources.
>
>> If you ever need to find the plugin a given class belongs to, use the
>> eclipse menu "navigate => open type" (ctrl+shift+T) then in the
>> package explorer, click on the icon with two arrows "Link with
>> editor". This should show you the .class file of the class you're
>> seeking. From there, simply look at the name of the jar this file is in.
>
>> Cheers,
>> Laurent Goubet
>> Obeo
>
>> Mark Melia a écrit :
>>> Laurent,
>>>
>>> Thanks again for your help. I imported the plugin jars:
>>> org.eclipse.equinox.common_3.4.0v20080201.jar, but I still have the
>>> same problem - I looked through this package and could not find the
>>> package the IFile class should be in.
>>> I also tried to get the code working by passing ModelUtils a File
>>> rather than a URI, but this gives me the following runtime error -
>>> do you have any ideas? Am I using the ModelUtils.load method with a
>>> java.io.File parameter correctly?
>>>
>>> Thanks for your help,
>>> Mark
>>>
>>> Exception in thread "main" java.lang.ExceptionInInitializerError
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:91)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:194)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMIHelperImpl.<init>(XMIHelperImpl.java:32)
>>>
>>> at
> org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLHelp er(XMIResourceImpl.java:53)
>
>>>
>>> at
> org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLLoad (XMIResourceImpl.java:59)
>
>>>
>>> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:166)
>
>>>
>>> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
>
>>>
>>> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1210)
>
>>>
>>> at
>>> org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :333)
>>> at
>>> org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :217)
>>> at test.Test.main(Test.java:29)
>>> Caused by: java.lang.SecurityException: SHA1 digest error for
>>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
>>> at
> sun.security.util.ManifestEntryVerifier.verify(ManifestEntry Verifier.java:194)
>
>>>
>>> at java.util.jar.JarVerifier.processEntry(JarVerifier.java:201)
>>> at java.util.jar.JarVerifier.update(JarVerifier.java:188)
>>> laurent Goubet wrote:
>>>
>>>> Mark,
>>>
>>>> Yup, org.eclipse.core.runtime is located in plug-in
>>>> org.eclipse.equinox.common. You need to add that one in your
>>>> dependencies as well.
>>>
>>>> Who said qualified names are unambiguous? :D
>>>
>>>> Cheers
>>>> Laurent Goubet
>>>> Obeo
>>>
>>>> Mark Melia a écrit :
>>>>> Hi Laurent,
>>>>>
>>>>> Thanks for your reply, I tried to put what you said into action -
>>>>> the code is below. I still have a problem, I get a build error
>>>>> which states that org.eclipse.core.runtime.IPath is required for
>>>>> creating model1, but when I have a look in my library files, there
>>>>> doesnt seem to be an IPath class in org.eclipse.core.runtime.
>>>>>
>>>>> I am using Eclipse 3.4, and installed EMF compare through the
>>>>> software updates mechinism, EMF Compare version is 0.8.0, can you
>>>>> see where I am going wrong?
>>>>>
>>>>> Thanks again,
>>>>> Mark
>>>>>
>>>>> CODE
>>>>>
>>>>> package test;
>>>>>
>>>>> import java.io.File;
>>>>> import java.util.Collections;
>>>>>
>>>>> import org.eclipse.emf.compare.diff.merge.service.MergeService;
>>>>> import org.eclipse.emf.compare.diff.metamodel.DiffModel;
>>>>> import org.eclipse.emf.compare.diff.service.DiffService;
>>>>> import org.eclipse.emf.compare.match.metamodel.MatchModel;
>>>>> import org.eclipse.emf.compare.match.service.MatchService;
>>>>> import org.eclipse.emf.compare.util.ModelUtils;
>>>>> import org.eclipse.emf.ecore.resource.Resource;
>>>>> import org.eclipse.emf.ecore.resource.ResourceSet;
>>>>> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
>>>>> import org.eclipse.emf.common.util.URI;
>>>>>
>>>>> public class Test {
>>>>>
>>>>> /**
>>>>> * @param args
>>>>> */
>>>>> public static void main(String[] args) {
>>>>> try {
>>>>> final ResourceSet modelResourceSet = new
>>>>> ResourceSetImpl();
>>>>> Resource model1 =
>>>
> ModelUtils.load(URI.createFileURI("/home/mark/workspace/ATestProject/mikaelHigh.ecore "),
>
>>>
>>>>> modelResourceSet).eResource();
>>>>> Resource model2 = ModelUtils.load(new
>>>>> java.io.File("/home/mark/workspace/ATestProject/mikaelLow.ecore "),
>>>>> modelResourceSet).eResource();
>>>>> // Matches elements of the two models
>>>>> final MatchModel match =
>>>>> MatchService.doResourceMatch(model1, model2, null);
>>>>> // Detects differences
>>>>> final DiffModel diff = DiffService.doDiff(match);
>>>>> // Merges all differences from model1 to model2
>>>>> MergeService.merge(diff.getOwnedElements(), true);
>>>>> } catch (Exception exception) {
>>>>> exception.printStackTrace();
>>>>> }
>>>>> }
>>>>>
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>> laurent Goubet wrote:
>>>>>
>>>>>> Sorry, clicked "send" before actually answering all questions ;).
>>>>>
>>>>>> About documentation on EMF Compare... Well we currently have no
>>>>>> real documentation other than the examples on eclipse CVS, the
>>>>>> home page http://www.eclipse.org/modeling/emft/?project=compare
>>>>>> on Eclipse and the wiki at
>>>>>> http://wiki.eclipse.org/index.php/EMF_Compare .
>>>>>
>>>>>> Laurent
>>>>>
>>>>>> laurent Goubet a écrit :
>>>>>>> Mark,
>>>>>>>
>>>>>>> EMF Compare would meet your needs if what you're looking for is
>>>>>>> to compare your two models and have a way to merge the
>>>>>>> differences between them. For example, if you wish to merge
>>>>>>> differences between model1 (old) and model2 (new) from left to
>>>>>>> right (undo differences in the new model), you can use
>>>>>>>
>>>>>>> // Matches elements of the two models
>>>>>>> final MatchModel match = MatchService.doResourceMatch(model1,
>>>>>>> model2, Collections.emptyMap());
>>>>>>> // Detects differences
>>>>>>> final DiffModel diff = DiffService.doDiff(match);
>>>>>>> // Merges all differences from model1 to model2
>>>>>>> MergeService.merge(diff.getOwnedElements());
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Laurent
>>>>>>>
>>>>>>> Mark Melia a écrit :
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> I am looking for something to merge two ecore models which are
>>>>>>>> defined according to the same metamodel - does anyone have an
>>>>>>>> idea. I would ideally like to use an ant script for the merge.
>>>>>>>>
>>>>>>>> I have been looking at EMF Compare but cant access the
>>>>>>>> developer guide, maybe someone can tell me if this would suit
>>>>>>>> my needs - possibly point me to a tutorial.
>>>>>>>>
>>>>>>>> Thanks for your help,
>>>>>>>> Mark
>>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Re: Merge EMF Models [message #115872 is a reply to message #115858] Wed, 26 March 2008 14:31 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060008090506080600040804
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Ed to the rescue :). So this could be JVM related? I must admit I have
never seen such exceptions.

Yet Mark did say he downloaded the correct dependencies from eclipse,
and those build IDs are indeed the correct ones.

As for disabling jar the jar signing verification ... well I doubt such
a jvm option exists as it would practically defeat the purpose of
signing jars.

@Mark : are you sure there is only a single version of EMF in your
classpath when you launch this app?

Cheers
Laurent Goubet
Obeo

Ed Merks a
Re: Merge EMF Models [message #115887 is a reply to message #115872] Wed, 26 March 2008 15:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------070501070703040100060300
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Laurent,

When I asked Nick about this familiar looking issue he said:

codeslave@c... if it's EMF 2.4M5 specifically, tell them to use an
I build
? otherwise, no clue 11:01:17 AM
merks Okay. 11:01:25 AM



laurent Goubet wrote:
> Ed to the rescue :). So this could be JVM related? I must admit I have
> never seen such exceptions.
>
> Yet Mark did say he downloaded the correct dependencies from eclipse,
> and those build IDs are indeed the correct ones.
>
> As for disabling jar the jar signing verification ... well I doubt
> such a jvm option exists as it would practically defeat the purpose of
> signing jars.
>
> @Mark : are you sure there is only a single version of EMF in your
> classpath when you launch this app?
>
> Cheers
> Laurent Goubet
> Obeo
>
> Ed Merks a
Re: Merge EMF Models [message #115899 is a reply to message #115858] Wed, 26 March 2008 15:12 Go to previous message
Eclipse UserFriend
Originally posted by: mmelia.computing.dcu.ie

Hi Ed,

I think you are thinking of the following bug
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5078608 which should be
fixed in the java version I am using.

I noted that someone else got this problem:
http://www.eclipsepowered.org/eclipse/forums/t107293.html, from the post
the guy got this solved by changing a plugin, so I will try another
version of the EMF plugin see if that makes any difference.

Mark

Ed Merks wrote:

> Mark,

> This looks to be a problem purely with the JVM not recognizing the
> signed jar as having been properly signed, though I'm sure the jar is
> properly signed. I think there might be a way to tell the JVM not to
> verify signatures as a workaround, but I don't recall the flag for
> that. I also seem to recall some issue with specific versions of
> certain JDKs having a bug related to this...


> Mark Melia wrote:
>> Hi Laurent,
>>
>> I dont think the problem is about the dependencies, as the error is
>> being caused by Caused by: java.lang.SecurityException: SHA1 digest
>> error for
>>>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
>> and the exception points to a line in the XMLHelperImpl.java (91) that
>> my eclipse says doesnt exist??
>>
>> I think I dont have the right combination of plugins that the EMF
>> compare jars were originally compiled with, but i did download the
>> dependencies from the site - they are as follows:
>> emft-compare-SDK-incubation-I200803130951
>> emf-sdo-xsd-SDK-I200803041800
>> eclipse-SDK-3.4M5-linux-gtk
>> JDK1.5.0_15
>>
>> can you see any problems with this? Do you think I am correct in my
>> diagnosis of the problem? Any thoughts?
>>
>> Thanks again for your time on this.
>> Mark
>>
>> laurent Goubet wrote:
>>
>>> Mark,
>>
>>> You need to resolve all dependencies before actually running the
>>> code. As said earlier, org.eclipse.core.runtime.IPath is located in
>>> org.eclipse.equinox.common, which you seem to have imported
>>> successfully. As for IFile, it is located in org.eclipse.core.resources.
>>
>>> If you ever need to find the plugin a given class belongs to, use the
>>> eclipse menu "navigate => open type" (ctrl+shift+T) then in the
>>> package explorer, click on the icon with two arrows "Link with
>>> editor". This should show you the .class file of the class you're
>>> seeking. From there, simply look at the name of the jar this file is in.
>>
>>> Cheers,
>>> Laurent Goubet
>>> Obeo
>>
>>> Mark Melia a écrit :
>>>> Laurent,
>>>>
>>>> Thanks again for your help. I imported the plugin jars:
>>>> org.eclipse.equinox.common_3.4.0v20080201.jar, but I still have the
>>>> same problem - I looked through this package and could not find the
>>>> package the IFile class should be in.
>>>> I also tried to get the code working by passing ModelUtils a File
>>>> rather than a URI, but this gives me the following runtime error -
>>>> do you have any ideas? Am I using the ModelUtils.load method with a
>>>> java.io.File parameter correctly?
>>>>
>>>> Thanks for your help,
>>>> Mark
>>>>
>>>> Exception in thread "main" java.lang.ExceptionInInitializerError
>>>> at
>>>>
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:91)
>>>>
>>>> at
>>>>
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:194)
>>>>
>>>> at
>>>>
org.eclipse.emf.ecore.xmi.impl.XMIHelperImpl.<init>(XMIHelperImpl.java:32)
>>>>
>>>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLHelp er(XMIResourceImpl.java:53)
>>
>>>>
>>>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLLoad (XMIResourceImpl.java:59)
>>
>>>>
>>>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:166)
>>
>>>>
>>>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
>>
>>>>
>>>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1210)
>>
>>>>
>>>> at
>>>> org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :333)
>>>> at
>>>> org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :217)
>>>> at test.Test.main(Test.java:29)
>>>> Caused by: java.lang.SecurityException: SHA1 digest error for
>>>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
>>>> at
>>
sun.security.util.ManifestEntryVerifier.verify(ManifestEntry Verifier.java:194)
>>
>>>>
>>>> at java.util.jar.JarVerifier.processEntry(JarVerifier.java:201)
>>>> at java.util.jar.JarVerifier.update(JarVerifier.java:188)
>>>> laurent Goubet wrote:
>>>>
>>>>> Mark,
>>>>
>>>>> Yup, org.eclipse.core.runtime is located in plug-in
>>>>> org.eclipse.equinox.common. You need to add that one in your
>>>>> dependencies as well.
>>>>
>>>>> Who said qualified names are unambiguous? :D
>>>>
>>>>> Cheers
>>>>> Laurent Goubet
>>>>> Obeo
>>>>
>>>>> Mark Melia a écrit :
>>>>>> Hi Laurent,
>>>>>>
>>>>>> Thanks for your reply, I tried to put what you said into action -
>>>>>> the code is below. I still have a problem, I get a build error
>>>>>> which states that org.eclipse.core.runtime.IPath is required for
>>>>>> creating model1, but when I have a look in my library files, there
>>>>>> doesnt seem to be an IPath class in org.eclipse.core.runtime.
>>>>>>
>>>>>> I am using Eclipse 3.4, and installed EMF compare through the
>>>>>> software updates mechinism, EMF Compare version is 0.8.0, can you
>>>>>> see where I am going wrong?
>>>>>>
>>>>>> Thanks again,
>>>>>> Mark
>>>>>>
>>>>>> CODE
>>>>>>
>>>>>> package test;
>>>>>>
>>>>>> import java.io.File;
>>>>>> import java.util.Collections;
>>>>>>
>>>>>> import org.eclipse.emf.compare.diff.merge.service.MergeService;
>>>>>> import org.eclipse.emf.compare.diff.metamodel.DiffModel;
>>>>>> import org.eclipse.emf.compare.diff.service.DiffService;
>>>>>> import org.eclipse.emf.compare.match.metamodel.MatchModel;
>>>>>> import org.eclipse.emf.compare.match.service.MatchService;
>>>>>> import org.eclipse.emf.compare.util.ModelUtils;
>>>>>> import org.eclipse.emf.ecore.resource.Resource;
>>>>>> import org.eclipse.emf.ecore.resource.ResourceSet;
>>>>>> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
>>>>>> import org.eclipse.emf.common.util.URI;
>>>>>>
>>>>>> public class Test {
>>>>>>
>>>>>> /**
>>>>>> * @param args
>>>>>> */
>>>>>> public static void main(String[] args) {
>>>>>> try {
>>>>>> final ResourceSet modelResourceSet = new
>>>>>> ResourceSetImpl();
>>>>>> Resource model1 =
>>>>
>>
ModelUtils.load(URI.createFileURI("/home/mark/workspace/ATestProject/mikaelHigh.ecore "),
>>
>>>>
>>>>>> modelResourceSet).eResource();
>>>>>> Resource model2 = ModelUtils.load(new
>>>>>> java.io.File("/home/mark/workspace/ATestProject/mikaelLow.ecore "),
>>>>>> modelResourceSet).eResource();
>>>>>> // Matches elements of the two models
>>>>>> final MatchModel match =
>>>>>> MatchService.doResourceMatch(model1, model2, null);
>>>>>> // Detects differences
>>>>>> final DiffModel diff = DiffService.doDiff(match);
>>>>>> // Merges all differences from model1 to model2
>>>>>> MergeService.merge(diff.getOwnedElements(), true);
>>>>>> } catch (Exception exception) {
>>>>>> exception.printStackTrace();
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> }
>>>>>>
>>>>>>
>>>>>>
>>>>>> laurent Goubet wrote:
>>>>>>
>>>>>>> Sorry, clicked "send" before actually answering all questions ;).
>>>>>>
>>>>>>> About documentation on EMF Compare... Well we currently have no
>>>>>>> real documentation other than the examples on eclipse CVS, the
>>>>>>> home page http://www.eclipse.org/modeling/emft/?project=compare
>>>>>>> on Eclipse and the wiki at
>>>>>>> http://wiki.eclipse.org/index.php/EMF_Compare .
>>>>>>
>>>>>>> Laurent
>>>>>>
>>>>>>> laurent Goubet a écrit :
>>>>>>>> Mark,
>>>>>>>>
>>>>>>>> EMF Compare would meet your needs if what you're looking for is
>>>>>>>> to compare your two models and have a way to merge the
>>>>>>>> differences between them. For example, if you wish to merge
>>>>>>>> differences between model1 (old) and model2 (new) from left to
>>>>>>>> right (undo differences in the new model), you can use
>>>>>>>>
>>>>>>>> // Matches elements of the two models
>>>>>>>> final MatchModel match = MatchService.doResourceMatch(model1,
>>>>>>>> model2, Collections.emptyMap());
>>>>>>>> // Detects differences
>>>>>>>> final DiffModel diff = DiffService.doDiff(match);
>>>>>>>> // Merges all differences from model1 to model2
>>>>>>>> MergeService.merge(diff.getOwnedElements());
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Laurent
>>>>>>>>
>>>>>>>> Mark Melia a écrit :
>>>>>>>>> Hi all,
>>>>>>>>>
>>>>>>>>> I am looking for something to merge two ecore models which are
>>>>>>>>> defined according to the same metamodel - does anyone have an
>>>>>>>>> idea. I would ideally like to use an ant script for the merge.
>>>>>>>>>
>>>>>>>>> I have been looking at EMF Compare but cant access the
>>>>>>>>> developer guide, maybe someone can tell me if this would suit
>>>>>>>>> my needs - possibly point me to a tutorial.
>>>>>>>>>
>>>>>>>>> Thanks for your help,
>>>>>>>>> Mark
>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
Re: Merge EMF Models [message #615938 is a reply to message #115181] Thu, 20 March 2008 11:56 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090309010109040405010705
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Mark,

EMF Compare would meet your needs if what you're looking for is to
compare your two models and have a way to merge the differences between
them. For example, if you wish to merge differences between model1 (old)
and model2 (new) from left to right (undo differences in the new model),
you can use

// Matches elements of the two models
final MatchModel match = MatchService.doResourceMatch(model1, model2,
Collections.emptyMap());
// Detects differences
final DiffModel diff = DiffService.doDiff(match);
// Merges all differences from model1 to model2
MergeService.merge(diff.getOwnedElements());

Cheers,
Laurent

Mark Melia a
Re: Merge EMF Models [message #615939 is a reply to message #115195] Thu, 20 March 2008 12:00 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010403090604040705030808
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Sorry, clicked "send" before actually answering all questions ;).

About documentation on EMF Compare... Well we currently have no real
documentation other than the examples on eclipse CVS, the home page
http://www.eclipse.org/modeling/emft/?project=compare on Eclipse and the
wiki at http://wiki.eclipse.org/index.php/EMF_Compare .

Laurent

laurent Goubet a
Re: Merge EMF Models [message #615968 is a reply to message #115207] Mon, 24 March 2008 22:11 Go to previous message
Mark Melia is currently offline Mark MeliaFriend
Messages: 142
Registered: July 2009
Senior Member
Hi Laurent,

Thanks for your reply, I tried to put what you said into action - the code
is below. I still have a problem, I get a build error which states that
org.eclipse.core.runtime.IPath is required for creating model1, but when I
have a look in my library files, there doesnt seem to be an IPath class in
org.eclipse.core.runtime.

I am using Eclipse 3.4, and installed EMF compare through the software
updates mechinism, EMF Compare version is 0.8.0, can you see where I am
going wrong?

Thanks again,
Mark

CODE

package test;

import java.io.File;
import java.util.Collections;

import org.eclipse.emf.compare.diff.merge.service.MergeService;
import org.eclipse.emf.compare.diff.metamodel.DiffModel;
import org.eclipse.emf.compare.diff.service.DiffService;
import org.eclipse.emf.compare.match.metamodel.MatchModel;
import org.eclipse.emf.compare.match.service.MatchService;
import org.eclipse.emf.compare.util.ModelUtils;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.common.util.URI;

public class Test {

/**
* @param args
*/
public static void main(String[] args) {
try
{
final ResourceSet modelResourceSet = new ResourceSetImpl();

Resource model1 =
ModelUtils.load(URI.createFileURI("/home/mark/workspace/ATestProject/mikaelHigh.ecore "),
modelResourceSet).eResource();
Resource model2 = ModelUtils.load(new
java.io.File("/home/mark/workspace/ATestProject/mikaelLow.ecore "),
modelResourceSet).eResource();
// Matches elements of the two models
final MatchModel match = MatchService.doResourceMatch(model1,
model2, null);
// Detects differences
final DiffModel diff = DiffService.doDiff(match);
// Merges all differences from model1 to model2
MergeService.merge(diff.getOwnedElements(), true);
}
catch (Exception exception)
{
exception.printStackTrace();

}


}

}



laurent Goubet wrote:

> Sorry, clicked "send" before actually answering all questions ;).

> About documentation on EMF Compare... Well we currently have no real
> documentation other than the examples on eclipse CVS, the home page
> http://www.eclipse.org/modeling/emft/?project=compare on Eclipse and the
> wiki at http://wiki.eclipse.org/index.php/EMF_Compare .

> Laurent

> laurent Goubet a écrit :
>> Mark,
>>
>> EMF Compare would meet your needs if what you're looking for is to
>> compare your two models and have a way to merge the differences between
>> them. For example, if you wish to merge differences between model1 (old)
>> and model2 (new) from left to right (undo differences in the new model),
>> you can use
>>
>> // Matches elements of the two models
>> final MatchModel match = MatchService.doResourceMatch(model1, model2,
>> Collections.emptyMap());
>> // Detects differences
>> final DiffModel diff = DiffService.doDiff(match);
>> // Merges all differences from model1 to model2
>> MergeService.merge(diff.getOwnedElements());
>>
>> Cheers,
>> Laurent
>>
>> Mark Melia a écrit :
>>> Hi all,
>>>
>>> I am looking for something to merge two ecore models which are defined
>>> according to the same metamodel - does anyone have an idea. I would
>>> ideally like to use an ant script for the merge.
>>>
>>> I have been looking at EMF Compare but cant access the developer
>>> guide, maybe someone can tell me if this would suit my needs -
>>> possibly point me to a tutorial.
>>>
>>> Thanks for your help,
>>> Mark
>>>
>>
Re: Merge EMF Models [message #615972 is a reply to message #115591] Tue, 25 March 2008 12:07 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080000020706080903060400
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Mark,

Yup, org.eclipse.core.runtime is located in plug-in
org.eclipse.equinox.common. You need to add that one in your
dependencies as well.

Who said qualified names are unambiguous? :D

Cheers
Laurent Goubet
Obeo

Mark Melia a
Merge EMF Models [message #615973 is a reply to message #115641] Tue, 25 March 2008 12:49 Go to previous message
Eclipse UserFriend
Originally posted by: arist102.hotmail.com

Hey Laurent,Mark,
I need your help too. I am a rookie in eclipse and I need also to merge 2
EMF models according to the same metamodel.I already installed EMF Compare
but I donŽt know further.Please can you help me?
thx Ari
Re: Merge EMF Models [message #615974 is a reply to message #115641] Tue, 25 March 2008 12:51 Go to previous message
Mark Melia is currently offline Mark MeliaFriend
Messages: 142
Registered: July 2009
Senior Member
Laurent,

Thanks again for your help. I imported the plugin jars:
org.eclipse.equinox.common_3.4.0v20080201.jar, but I still have the same
problem - I looked through this package and could not find the package the
IFile class should be in.

I also tried to get the code working by passing ModelUtils a File rather
than a URI, but this gives me the following runtime error - do you have
any ideas? Am I using the ModelUtils.load method with a java.io.File
parameter correctly?

Thanks for your help,
Mark

Exception in thread "main" java.lang.ExceptionInInitializerError
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:91)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:194)
at
org.eclipse.emf.ecore.xmi.impl.XMIHelperImpl.<init>(XMIHelperImpl.java:32)
at
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLHelp er(XMIResourceImpl.java:53)
at
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLLoad (XMIResourceImpl.java:59)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:166)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1210)
at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :333)
at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :217)
at test.Test.main(Test.java:29)
Caused by: java.lang.SecurityException: SHA1 digest error for
org/eclipse/emf/ecore/util/ECrossReferenceEList.class
at
sun.security.util.ManifestEntryVerifier.verify(ManifestEntry Verifier.java:194)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:201)
at java.util.jar.JarVerifier.update(JarVerifier.java:188)
laurent Goubet wrote:

> Mark,

> Yup, org.eclipse.core.runtime is located in plug-in
> org.eclipse.equinox.common. You need to add that one in your
> dependencies as well.

> Who said qualified names are unambiguous? :D

> Cheers
> Laurent Goubet
> Obeo

> Mark Melia a écrit :
>> Hi Laurent,
>>
>> Thanks for your reply, I tried to put what you said into action - the
>> code is below. I still have a problem, I get a build error which states
>> that org.eclipse.core.runtime.IPath is required for creating model1,
>> but when I have a look in my library files, there doesnt seem to be an
>> IPath class in org.eclipse.core.runtime.
>>
>> I am using Eclipse 3.4, and installed EMF compare through the software
>> updates mechinism, EMF Compare version is 0.8.0, can you see where I am
>> going wrong?
>>
>> Thanks again,
>> Mark
>>
>> CODE
>>
>> package test;
>>
>> import java.io.File;
>> import java.util.Collections;
>>
>> import org.eclipse.emf.compare.diff.merge.service.MergeService;
>> import org.eclipse.emf.compare.diff.metamodel.DiffModel;
>> import org.eclipse.emf.compare.diff.service.DiffService;
>> import org.eclipse.emf.compare.match.metamodel.MatchModel;
>> import org.eclipse.emf.compare.match.service.MatchService;
>> import org.eclipse.emf.compare.util.ModelUtils;
>> import org.eclipse.emf.ecore.resource.Resource;
>> import org.eclipse.emf.ecore.resource.ResourceSet;
>> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
>> import org.eclipse.emf.common.util.URI;
>>
>> public class Test {
>>
>> /**
>> * @param args
>> */
>> public static void main(String[] args) {
>> try {
>> final ResourceSet modelResourceSet = new ResourceSetImpl();
>>
>> Resource model1 =
>>
ModelUtils.load(URI.createFileURI("/home/mark/workspace/ATestProject/mikaelHigh.ecore "),
>> modelResourceSet).eResource();
>> Resource model2 = ModelUtils.load(new
>> java.io.File("/home/mark/workspace/ATestProject/mikaelLow.ecore "),
>> modelResourceSet).eResource();
>> // Matches elements of the two models
>> final MatchModel match = MatchService.doResourceMatch(model1,
>> model2, null);
>> // Detects differences
>> final DiffModel diff = DiffService.doDiff(match);
>> // Merges all differences from model1 to model2
>> MergeService.merge(diff.getOwnedElements(), true);
>> } catch (Exception exception) {
>> exception.printStackTrace();
>>
>> }
>>
>> }
>>
>> }
>>
>>
>>
>> laurent Goubet wrote:
>>
>>> Sorry, clicked "send" before actually answering all questions ;).
>>
>>> About documentation on EMF Compare... Well we currently have no real
>>> documentation other than the examples on eclipse CVS, the home page
>>> http://www.eclipse.org/modeling/emft/?project=compare on Eclipse and
>>> the wiki at http://wiki.eclipse.org/index.php/EMF_Compare .
>>
>>> Laurent
>>
>>> laurent Goubet a écrit :
>>>> Mark,
>>>>
>>>> EMF Compare would meet your needs if what you're looking for is to
>>>> compare your two models and have a way to merge the differences
>>>> between them. For example, if you wish to merge differences between
>>>> model1 (old) and model2 (new) from left to right (undo differences in
>>>> the new model), you can use
>>>>
>>>> // Matches elements of the two models
>>>> final MatchModel match = MatchService.doResourceMatch(model1, model2,
>>>> Collections.emptyMap());
>>>> // Detects differences
>>>> final DiffModel diff = DiffService.doDiff(match);
>>>> // Merges all differences from model1 to model2
>>>> MergeService.merge(diff.getOwnedElements());
>>>>
>>>> Cheers,
>>>> Laurent
>>>>
>>>> Mark Melia a écrit :
>>>>> Hi all,
>>>>>
>>>>> I am looking for something to merge two ecore models which are
>>>>> defined according to the same metamodel - does anyone have an idea.
>>>>> I would ideally like to use an ant script for the merge.
>>>>>
>>>>> I have been looking at EMF Compare but cant access the developer
>>>>> guide, maybe someone can tell me if this would suit my needs -
>>>>> possibly point me to a tutorial.
>>>>>
>>>>> Thanks for your help,
>>>>> Mark
>>>>>
>>>>
>>
>>
Re: Merge EMF Models [message #615975 is a reply to message #115654] Tue, 25 March 2008 13:08 Go to previous message
Mark Melia is currently offline Mark MeliaFriend
Messages: 142
Registered: July 2009
Senior Member
Hi Ari,

I am doing exactly what you are doing, so hopefully between the two of us,
we will get EMF compare working. At the moment I am working with Laurent
to get a simple example working, you can see my code in a previous post. I
am still having some trouble with this, as you can also see from my posts.

I have also found some of the code used by Laurent and his team usful in
the eclipse dev site
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org .eclipse.emf.compare/plugins/org.eclipse.emf.compare.ui/src/ org/eclipse/emf/compare/?root=Modeling_Project

Mark

Ari wrote:

> Hey Laurent,Mark,
> I need your help too. I am a rookie in eclipse and I need also to merge 2
> EMF models according to the same metamodel.I already installed EMF Compare
> but I donŽt know further.Please can you help me?
> thx Ari
Re: Merge EMF Models [message #615978 is a reply to message #115668] Wed, 26 March 2008 07:50 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040804010601030507010401
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Mark,

You need to resolve all dependencies before actually running the code.
As said earlier, org.eclipse.core.runtime.IPath is located in
org.eclipse.equinox.common, which you seem to have imported
successfully. As for IFile, it is located in org.eclipse.core.resources.

If you ever need to find the plugin a given class belongs to, use the
eclipse menu "navigate => open type" (ctrl+shift+T) then in the package
explorer, click on the icon with two arrows "Link with editor". This
should show you the .class file of the class you're seeking. From there,
simply look at the name of the jar this file is in.

Cheers,
Laurent Goubet
Obeo

Mark Melia a
Re: Merge EMF Models [message #615979 is a reply to message #115681] Wed, 26 March 2008 07:59 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000808080808070203010507
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Ari,

If you don't give us any more information, it might be difficult to help
you out ;). Here's a somewhat generic answer :

How do you wish to compare/merge your models? 1) Directly from eclipse
(GUI)? Or 2) programmatically?

If 1), you simply have to select your two models in eclipse's package
explorer, right-click, then select "compare with => each other". The
comparison result shows up (might take a while depending on your models'
size) and you simply have to select the action "copy all changes from
left(right) to right(left)".

If 2), you might be interested in reading this whole thread, then asking
us what you do not understand.

Cheers,
Laurent Goubet
Obeo

Mark Melia a
Re: Merge EMF Models [message #615986 is a reply to message #115726] Wed, 26 March 2008 13:28 Go to previous message
Mark Melia is currently offline Mark MeliaFriend
Messages: 142
Registered: July 2009
Senior Member
Hi Laurent,

I dont think the problem is about the dependencies, as the error is being
caused by
Caused by: java.lang.SecurityException: SHA1 digest error for
>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
and the exception points to a line in the XMLHelperImpl.java (91) that my
eclipse says doesnt exist??

I think I dont have the right combination of plugins that the EMF compare
jars were originally compiled with, but i did download the dependencies
from the site - they are as follows:
emft-compare-SDK-incubation-I200803130951
emf-sdo-xsd-SDK-I200803041800
eclipse-SDK-3.4M5-linux-gtk
JDK1.5.0_15

can you see any problems with this? Do you think I am correct in my
diagnosis of the problem? Any thoughts?

Thanks again for your time on this.
Mark

laurent Goubet wrote:

> Mark,

> You need to resolve all dependencies before actually running the code.
> As said earlier, org.eclipse.core.runtime.IPath is located in
> org.eclipse.equinox.common, which you seem to have imported
> successfully. As for IFile, it is located in org.eclipse.core.resources.

> If you ever need to find the plugin a given class belongs to, use the
> eclipse menu "navigate => open type" (ctrl+shift+T) then in the package
> explorer, click on the icon with two arrows "Link with editor". This
> should show you the .class file of the class you're seeking. From there,
> simply look at the name of the jar this file is in.

> Cheers,
> Laurent Goubet
> Obeo

> Mark Melia a écrit :
>> Laurent,
>>
>> Thanks again for your help. I imported the plugin jars:
>> org.eclipse.equinox.common_3.4.0v20080201.jar, but I still have the same
>> problem - I looked through this package and could not find the package
>> the IFile class should be in.
>> I also tried to get the code working by passing ModelUtils a File rather
>> than a URI, but this gives me the following runtime error - do you have
>> any ideas? Am I using the ModelUtils.load method with a java.io.File
>> parameter correctly?
>>
>> Thanks for your help,
>> Mark
>>
>> Exception in thread "main" java.lang.ExceptionInInitializerError
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:91)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:194)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMIHelperImpl.<init>(XMIHelperImpl.java:32)
>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLHelp er(XMIResourceImpl.java:53)
>>
>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLLoad (XMIResourceImpl.java:59)
>>
>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:166)
>>
>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
>>
>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1210)
>>
>> at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :333)
>> at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :217)
>> at test.Test.main(Test.java:29)
>> Caused by: java.lang.SecurityException: SHA1 digest error for
>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
>> at
>>
sun.security.util.ManifestEntryVerifier.verify(ManifestEntry Verifier.java:194)
>>
>> at java.util.jar.JarVerifier.processEntry(JarVerifier.java:201)
>> at java.util.jar.JarVerifier.update(JarVerifier.java:188)
>> laurent Goubet wrote:
>>
>>> Mark,
>>
>>> Yup, org.eclipse.core.runtime is located in plug-in
>>> org.eclipse.equinox.common. You need to add that one in your
>>> dependencies as well.
>>
>>> Who said qualified names are unambiguous? :D
>>
>>> Cheers
>>> Laurent Goubet
>>> Obeo
>>
>>> Mark Melia a écrit :
>>>> Hi Laurent,
>>>>
>>>> Thanks for your reply, I tried to put what you said into action - the
>>>> code is below. I still have a problem, I get a build error which
>>>> states that org.eclipse.core.runtime.IPath is required for creating
>>>> model1, but when I have a look in my library files, there doesnt seem
>>>> to be an IPath class in org.eclipse.core.runtime.
>>>>
>>>> I am using Eclipse 3.4, and installed EMF compare through the
>>>> software updates mechinism, EMF Compare version is 0.8.0, can you see
>>>> where I am going wrong?
>>>>
>>>> Thanks again,
>>>> Mark
>>>>
>>>> CODE
>>>>
>>>> package test;
>>>>
>>>> import java.io.File;
>>>> import java.util.Collections;
>>>>
>>>> import org.eclipse.emf.compare.diff.merge.service.MergeService;
>>>> import org.eclipse.emf.compare.diff.metamodel.DiffModel;
>>>> import org.eclipse.emf.compare.diff.service.DiffService;
>>>> import org.eclipse.emf.compare.match.metamodel.MatchModel;
>>>> import org.eclipse.emf.compare.match.service.MatchService;
>>>> import org.eclipse.emf.compare.util.ModelUtils;
>>>> import org.eclipse.emf.ecore.resource.Resource;
>>>> import org.eclipse.emf.ecore.resource.ResourceSet;
>>>> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
>>>> import org.eclipse.emf.common.util.URI;
>>>>
>>>> public class Test {
>>>>
>>>> /**
>>>> * @param args
>>>> */
>>>> public static void main(String[] args) {
>>>> try {
>>>> final ResourceSet modelResourceSet = new ResourceSetImpl();
>>>> Resource model1 =
>>
ModelUtils.load(URI.createFileURI("/home/mark/workspace/ATestProject/mikaelHigh.ecore "),
>>
>>>> modelResourceSet).eResource();
>>>> Resource model2 = ModelUtils.load(new
>>>> java.io.File("/home/mark/workspace/ATestProject/mikaelLow.ecore "),
>>>> modelResourceSet).eResource();
>>>> // Matches elements of the two models
>>>> final MatchModel match =
>>>> MatchService.doResourceMatch(model1, model2, null);
>>>> // Detects differences
>>>> final DiffModel diff = DiffService.doDiff(match);
>>>> // Merges all differences from model1 to model2
>>>> MergeService.merge(diff.getOwnedElements(), true);
>>>> } catch (Exception exception) {
>>>> exception.printStackTrace();
>>>> }
>>>> }
>>>>
>>>> }
>>>>
>>>>
>>>>
>>>> laurent Goubet wrote:
>>>>
>>>>> Sorry, clicked "send" before actually answering all questions ;).
>>>>
>>>>> About documentation on EMF Compare... Well we currently have no real
>>>>> documentation other than the examples on eclipse CVS, the home page
>>>>> http://www.eclipse.org/modeling/emft/?project=compare on Eclipse and
>>>>> the wiki at http://wiki.eclipse.org/index.php/EMF_Compare .
>>>>
>>>>> Laurent
>>>>
>>>>> laurent Goubet a écrit :
>>>>>> Mark,
>>>>>>
>>>>>> EMF Compare would meet your needs if what you're looking for is to
>>>>>> compare your two models and have a way to merge the differences
>>>>>> between them. For example, if you wish to merge differences between
>>>>>> model1 (old) and model2 (new) from left to right (undo differences
>>>>>> in the new model), you can use
>>>>>>
>>>>>> // Matches elements of the two models
>>>>>> final MatchModel match = MatchService.doResourceMatch(model1,
>>>>>> model2, Collections.emptyMap());
>>>>>> // Detects differences
>>>>>> final DiffModel diff = DiffService.doDiff(match);
>>>>>> // Merges all differences from model1 to model2
>>>>>> MergeService.merge(diff.getOwnedElements());
>>>>>>
>>>>>> Cheers,
>>>>>> Laurent
>>>>>>
>>>>>> Mark Melia a écrit :
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I am looking for something to merge two ecore models which are
>>>>>>> defined according to the same metamodel - does anyone have an
>>>>>>> idea. I would ideally like to use an ant script for the merge.
>>>>>>>
>>>>>>> I have been looking at EMF Compare but cant access the developer
>>>>>>> guide, maybe someone can tell me if this would suit my needs -
>>>>>>> possibly point me to a tutorial.
>>>>>>>
>>>>>>> Thanks for your help,
>>>>>>> Mark
>>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
Re: Merge EMF Models [message #615988 is a reply to message #115832] Wed, 26 March 2008 14:02 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31959
Registered: July 2009
Senior Member
Mark,

This looks to be a problem purely with the JVM not recognizing the
signed jar as having been properly signed, though I'm sure the jar is
properly signed. I think there might be a way to tell the JVM not to
verify signatures as a workaround, but I don't recall the flag for
that. I also seem to recall some issue with specific versions of
certain JDKs having a bug related to this...


Mark Melia wrote:
> Hi Laurent,
>
> I dont think the problem is about the dependencies, as the error is
> being caused by Caused by: java.lang.SecurityException: SHA1 digest
> error for
>>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
> and the exception points to a line in the XMLHelperImpl.java (91) that
> my eclipse says doesnt exist??
>
> I think I dont have the right combination of plugins that the EMF
> compare jars were originally compiled with, but i did download the
> dependencies from the site - they are as follows:
> emft-compare-SDK-incubation-I200803130951
> emf-sdo-xsd-SDK-I200803041800
> eclipse-SDK-3.4M5-linux-gtk
> JDK1.5.0_15
>
> can you see any problems with this? Do you think I am correct in my
> diagnosis of the problem? Any thoughts?
>
> Thanks again for your time on this.
> Mark
>
> laurent Goubet wrote:
>
>> Mark,
>
>> You need to resolve all dependencies before actually running the
>> code. As said earlier, org.eclipse.core.runtime.IPath is located in
>> org.eclipse.equinox.common, which you seem to have imported
>> successfully. As for IFile, it is located in org.eclipse.core.resources.
>
>> If you ever need to find the plugin a given class belongs to, use the
>> eclipse menu "navigate => open type" (ctrl+shift+T) then in the
>> package explorer, click on the icon with two arrows "Link with
>> editor". This should show you the .class file of the class you're
>> seeking. From there, simply look at the name of the jar this file is in.
>
>> Cheers,
>> Laurent Goubet
>> Obeo
>
>> Mark Melia a écrit :
>>> Laurent,
>>>
>>> Thanks again for your help. I imported the plugin jars:
>>> org.eclipse.equinox.common_3.4.0v20080201.jar, but I still have the
>>> same problem - I looked through this package and could not find the
>>> package the IFile class should be in.
>>> I also tried to get the code working by passing ModelUtils a File
>>> rather than a URI, but this gives me the following runtime error -
>>> do you have any ideas? Am I using the ModelUtils.load method with a
>>> java.io.File parameter correctly?
>>>
>>> Thanks for your help,
>>> Mark
>>>
>>> Exception in thread "main" java.lang.ExceptionInInitializerError
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:91)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:194)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMIHelperImpl.<init>(XMIHelperImpl.java:32)
>>>
>>> at
> org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLHelp er(XMIResourceImpl.java:53)
>
>>>
>>> at
> org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLLoad (XMIResourceImpl.java:59)
>
>>>
>>> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:166)
>
>>>
>>> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
>
>>>
>>> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1210)
>
>>>
>>> at
>>> org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :333)
>>> at
>>> org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :217)
>>> at test.Test.main(Test.java:29)
>>> Caused by: java.lang.SecurityException: SHA1 digest error for
>>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
>>> at
> sun.security.util.ManifestEntryVerifier.verify(ManifestEntry Verifier.java:194)
>
>>>
>>> at java.util.jar.JarVerifier.processEntry(JarVerifier.java:201)
>>> at java.util.jar.JarVerifier.update(JarVerifier.java:188)
>>> laurent Goubet wrote:
>>>
>>>> Mark,
>>>
>>>> Yup, org.eclipse.core.runtime is located in plug-in
>>>> org.eclipse.equinox.common. You need to add that one in your
>>>> dependencies as well.
>>>
>>>> Who said qualified names are unambiguous? :D
>>>
>>>> Cheers
>>>> Laurent Goubet
>>>> Obeo
>>>
>>>> Mark Melia a écrit :
>>>>> Hi Laurent,
>>>>>
>>>>> Thanks for your reply, I tried to put what you said into action -
>>>>> the code is below. I still have a problem, I get a build error
>>>>> which states that org.eclipse.core.runtime.IPath is required for
>>>>> creating model1, but when I have a look in my library files, there
>>>>> doesnt seem to be an IPath class in org.eclipse.core.runtime.
>>>>>
>>>>> I am using Eclipse 3.4, and installed EMF compare through the
>>>>> software updates mechinism, EMF Compare version is 0.8.0, can you
>>>>> see where I am going wrong?
>>>>>
>>>>> Thanks again,
>>>>> Mark
>>>>>
>>>>> CODE
>>>>>
>>>>> package test;
>>>>>
>>>>> import java.io.File;
>>>>> import java.util.Collections;
>>>>>
>>>>> import org.eclipse.emf.compare.diff.merge.service.MergeService;
>>>>> import org.eclipse.emf.compare.diff.metamodel.DiffModel;
>>>>> import org.eclipse.emf.compare.diff.service.DiffService;
>>>>> import org.eclipse.emf.compare.match.metamodel.MatchModel;
>>>>> import org.eclipse.emf.compare.match.service.MatchService;
>>>>> import org.eclipse.emf.compare.util.ModelUtils;
>>>>> import org.eclipse.emf.ecore.resource.Resource;
>>>>> import org.eclipse.emf.ecore.resource.ResourceSet;
>>>>> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
>>>>> import org.eclipse.emf.common.util.URI;
>>>>>
>>>>> public class Test {
>>>>>
>>>>> /**
>>>>> * @param args
>>>>> */
>>>>> public static void main(String[] args) {
>>>>> try {
>>>>> final ResourceSet modelResourceSet = new
>>>>> ResourceSetImpl();
>>>>> Resource model1 =
>>>
> ModelUtils.load(URI.createFileURI("/home/mark/workspace/ATestProject/mikaelHigh.ecore "),
>
>>>
>>>>> modelResourceSet).eResource();
>>>>> Resource model2 = ModelUtils.load(new
>>>>> java.io.File("/home/mark/workspace/ATestProject/mikaelLow.ecore "),
>>>>> modelResourceSet).eResource();
>>>>> // Matches elements of the two models
>>>>> final MatchModel match =
>>>>> MatchService.doResourceMatch(model1, model2, null);
>>>>> // Detects differences
>>>>> final DiffModel diff = DiffService.doDiff(match);
>>>>> // Merges all differences from model1 to model2
>>>>> MergeService.merge(diff.getOwnedElements(), true);
>>>>> } catch (Exception exception) {
>>>>> exception.printStackTrace();
>>>>> }
>>>>> }
>>>>>
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>> laurent Goubet wrote:
>>>>>
>>>>>> Sorry, clicked "send" before actually answering all questions ;).
>>>>>
>>>>>> About documentation on EMF Compare... Well we currently have no
>>>>>> real documentation other than the examples on eclipse CVS, the
>>>>>> home page http://www.eclipse.org/modeling/emft/?project=compare
>>>>>> on Eclipse and the wiki at
>>>>>> http://wiki.eclipse.org/index.php/EMF_Compare .
>>>>>
>>>>>> Laurent
>>>>>
>>>>>> laurent Goubet a écrit :
>>>>>>> Mark,
>>>>>>>
>>>>>>> EMF Compare would meet your needs if what you're looking for is
>>>>>>> to compare your two models and have a way to merge the
>>>>>>> differences between them. For example, if you wish to merge
>>>>>>> differences between model1 (old) and model2 (new) from left to
>>>>>>> right (undo differences in the new model), you can use
>>>>>>>
>>>>>>> // Matches elements of the two models
>>>>>>> final MatchModel match = MatchService.doResourceMatch(model1,
>>>>>>> model2, Collections.emptyMap());
>>>>>>> // Detects differences
>>>>>>> final DiffModel diff = DiffService.doDiff(match);
>>>>>>> // Merges all differences from model1 to model2
>>>>>>> MergeService.merge(diff.getOwnedElements());
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Laurent
>>>>>>>
>>>>>>> Mark Melia a écrit :
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> I am looking for something to merge two ecore models which are
>>>>>>>> defined according to the same metamodel - does anyone have an
>>>>>>>> idea. I would ideally like to use an ant script for the merge.
>>>>>>>>
>>>>>>>> I have been looking at EMF Compare but cant access the
>>>>>>>> developer guide, maybe someone can tell me if this would suit
>>>>>>>> my needs - possibly point me to a tutorial.
>>>>>>>>
>>>>>>>> Thanks for your help,
>>>>>>>> Mark
>>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Merge EMF Models [message #615989 is a reply to message #115858] Wed, 26 March 2008 14:31 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060008090506080600040804
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Ed to the rescue :). So this could be JVM related? I must admit I have
never seen such exceptions.

Yet Mark did say he downloaded the correct dependencies from eclipse,
and those build IDs are indeed the correct ones.

As for disabling jar the jar signing verification ... well I doubt such
a jvm option exists as it would practically defeat the purpose of
signing jars.

@Mark : are you sure there is only a single version of EMF in your
classpath when you launch this app?

Cheers
Laurent Goubet
Obeo

Ed Merks a
Re: Merge EMF Models [message #615990 is a reply to message #115872] Wed, 26 March 2008 15:02 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31959
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070501070703040100060300
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Laurent,

When I asked Nick about this familiar looking issue he said:

codeslave@c... if it's EMF 2.4M5 specifically, tell them to use an
I build
? otherwise, no clue 11:01:17 AM
merks Okay. 11:01:25 AM



laurent Goubet wrote:
> Ed to the rescue :). So this could be JVM related? I must admit I have
> never seen such exceptions.
>
> Yet Mark did say he downloaded the correct dependencies from eclipse,
> and those build IDs are indeed the correct ones.
>
> As for disabling jar the jar signing verification ... well I doubt
> such a jvm option exists as it would practically defeat the purpose of
> signing jars.
>
> @Mark : are you sure there is only a single version of EMF in your
> classpath when you launch this app?
>
> Cheers
> Laurent Goubet
> Obeo
>
> Ed Merks a


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Merge EMF Models [message #615991 is a reply to message #115858] Wed, 26 March 2008 15:12 Go to previous message
Mark Melia is currently offline Mark MeliaFriend
Messages: 142
Registered: July 2009
Senior Member
Hi Ed,

I think you are thinking of the following bug
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5078608 which should be
fixed in the java version I am using.

I noted that someone else got this problem:
http://www.eclipsepowered.org/eclipse/forums/t107293.html, from the post
the guy got this solved by changing a plugin, so I will try another
version of the EMF plugin see if that makes any difference.

Mark

Ed Merks wrote:

> Mark,

> This looks to be a problem purely with the JVM not recognizing the
> signed jar as having been properly signed, though I'm sure the jar is
> properly signed. I think there might be a way to tell the JVM not to
> verify signatures as a workaround, but I don't recall the flag for
> that. I also seem to recall some issue with specific versions of
> certain JDKs having a bug related to this...


> Mark Melia wrote:
>> Hi Laurent,
>>
>> I dont think the problem is about the dependencies, as the error is
>> being caused by Caused by: java.lang.SecurityException: SHA1 digest
>> error for
>>>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
>> and the exception points to a line in the XMLHelperImpl.java (91) that
>> my eclipse says doesnt exist??
>>
>> I think I dont have the right combination of plugins that the EMF
>> compare jars were originally compiled with, but i did download the
>> dependencies from the site - they are as follows:
>> emft-compare-SDK-incubation-I200803130951
>> emf-sdo-xsd-SDK-I200803041800
>> eclipse-SDK-3.4M5-linux-gtk
>> JDK1.5.0_15
>>
>> can you see any problems with this? Do you think I am correct in my
>> diagnosis of the problem? Any thoughts?
>>
>> Thanks again for your time on this.
>> Mark
>>
>> laurent Goubet wrote:
>>
>>> Mark,
>>
>>> You need to resolve all dependencies before actually running the
>>> code. As said earlier, org.eclipse.core.runtime.IPath is located in
>>> org.eclipse.equinox.common, which you seem to have imported
>>> successfully. As for IFile, it is located in org.eclipse.core.resources.
>>
>>> If you ever need to find the plugin a given class belongs to, use the
>>> eclipse menu "navigate => open type" (ctrl+shift+T) then in the
>>> package explorer, click on the icon with two arrows "Link with
>>> editor". This should show you the .class file of the class you're
>>> seeking. From there, simply look at the name of the jar this file is in.
>>
>>> Cheers,
>>> Laurent Goubet
>>> Obeo
>>
>>> Mark Melia a écrit :
>>>> Laurent,
>>>>
>>>> Thanks again for your help. I imported the plugin jars:
>>>> org.eclipse.equinox.common_3.4.0v20080201.jar, but I still have the
>>>> same problem - I looked through this package and could not find the
>>>> package the IFile class should be in.
>>>> I also tried to get the code working by passing ModelUtils a File
>>>> rather than a URI, but this gives me the following runtime error -
>>>> do you have any ideas? Am I using the ModelUtils.load method with a
>>>> java.io.File parameter correctly?
>>>>
>>>> Thanks for your help,
>>>> Mark
>>>>
>>>> Exception in thread "main" java.lang.ExceptionInInitializerError
>>>> at
>>>>
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:91)
>>>>
>>>> at
>>>>
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.<init>(XMLHelperImpl.java:194)
>>>>
>>>> at
>>>>
org.eclipse.emf.ecore.xmi.impl.XMIHelperImpl.<init>(XMIHelperImpl.java:32)
>>>>
>>>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLHelp er(XMIResourceImpl.java:53)
>>
>>>>
>>>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl.createXMLLoad (XMIResourceImpl.java:59)
>>
>>>>
>>>> at
>>
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:166)
>>
>>>>
>>>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
>>
>>>>
>>>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1210)
>>
>>>>
>>>> at
>>>> org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :333)
>>>> at
>>>> org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :217)
>>>> at test.Test.main(Test.java:29)
>>>> Caused by: java.lang.SecurityException: SHA1 digest error for
>>>> org/eclipse/emf/ecore/util/ECrossReferenceEList.class
>>>> at
>>
sun.security.util.ManifestEntryVerifier.verify(ManifestEntry Verifier.java:194)
>>
>>>>
>>>> at java.util.jar.JarVerifier.processEntry(JarVerifier.java:201)
>>>> at java.util.jar.JarVerifier.update(JarVerifier.java:188)
>>>> laurent Goubet wrote:
>>>>
>>>>> Mark,
>>>>
>>>>> Yup, org.eclipse.core.runtime is located in plug-in
>>>>> org.eclipse.equinox.common. You need to add that one in your
>>>>> dependencies as well.
>>>>
>>>>> Who said qualified names are unambiguous? :D
>>>>
>>>>> Cheers
>>>>> Laurent Goubet
>>>>> Obeo
>>>>
>>>>> Mark Melia a écrit :
>>>>>> Hi Laurent,
>>>>>>
>>>>>> Thanks for your reply, I tried to put what you said into action -
>>>>>> the code is below. I still have a problem, I get a build error
>>>>>> which states that org.eclipse.core.runtime.IPath is required for
>>>>>> creating model1, but when I have a look in my library files, there
>>>>>> doesnt seem to be an IPath class in org.eclipse.core.runtime.
>>>>>>
>>>>>> I am using Eclipse 3.4, and installed EMF compare through the
>>>>>> software updates mechinism, EMF Compare version is 0.8.0, can you
>>>>>> see where I am going wrong?
>>>>>>
>>>>>> Thanks again,
>>>>>> Mark
>>>>>>
>>>>>> CODE
>>>>>>
>>>>>> package test;
>>>>>>
>>>>>> import java.io.File;
>>>>>> import java.util.Collections;
>>>>>>
>>>>>> import org.eclipse.emf.compare.diff.merge.service.MergeService;
>>>>>> import org.eclipse.emf.compare.diff.metamodel.DiffModel;
>>>>>> import org.eclipse.emf.compare.diff.service.DiffService;
>>>>>> import org.eclipse.emf.compare.match.metamodel.MatchModel;
>>>>>> import org.eclipse.emf.compare.match.service.MatchService;
>>>>>> import org.eclipse.emf.compare.util.ModelUtils;
>>>>>> import org.eclipse.emf.ecore.resource.Resource;
>>>>>> import org.eclipse.emf.ecore.resource.ResourceSet;
>>>>>> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
>>>>>> import org.eclipse.emf.common.util.URI;
>>>>>>
>>>>>> public class Test {
>>>>>>
>>>>>> /**
>>>>>> * @param args
>>>>>> */
>>>>>> public static void main(String[] args) {
>>>>>> try {
>>>>>> final ResourceSet modelResourceSet = new
>>>>>> ResourceSetImpl();
>>>>>> Resource model1 =
>>>>
>>
ModelUtils.load(URI.createFileURI("/home/mark/workspace/ATestProject/mikaelHigh.ecore "),
>>
>>>>
>>>>>> modelResourceSet).eResource();
>>>>>> Resource model2 = ModelUtils.load(new
>>>>>> java.io.File("/home/mark/workspace/ATestProject/mikaelLow.ecore "),
>>>>>> modelResourceSet).eResource();
>>>>>> // Matches elements of the two models
>>>>>> final MatchModel match =
>>>>>> MatchService.doResourceMatch(model1, model2, null);
>>>>>> // Detects differences
>>>>>> final DiffModel diff = DiffService.doDiff(match);
>>>>>> // Merges all differences from model1 to model2
>>>>>> MergeService.merge(diff.getOwnedElements(), true);
>>>>>> } catch (Exception exception) {
>>>>>> exception.printStackTrace();
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> }
>>>>>>
>>>>>>
>>>>>>
>>>>>> laurent Goubet wrote:
>>>>>>
>>>>>>> Sorry, clicked "send" before actually answering all questions ;).
>>>>>>
>>>>>>> About documentation on EMF Compare... Well we currently have no
>>>>>>> real documentation other than the examples on eclipse CVS, the
>>>>>>> home page http://www.eclipse.org/modeling/emft/?project=compare
>>>>>>> on Eclipse and the wiki at
>>>>>>> http://wiki.eclipse.org/index.php/EMF_Compare .
>>>>>>
>>>>>>> Laurent
>>>>>>
>>>>>>> laurent Goubet a écrit :
>>>>>>>> Mark,
>>>>>>>>
>>>>>>>> EMF Compare would meet your needs if what you're looking for is
>>>>>>>> to compare your two models and have a way to merge the
>>>>>>>> differences between them. For example, if you wish to merge
>>>>>>>> differences between model1 (old) and model2 (new) from left to
>>>>>>>> right (undo differences in the new model), you can use
>>>>>>>>
>>>>>>>> // Matches elements of the two models
>>>>>>>> final MatchModel match = MatchService.doResourceMatch(model1,
>>>>>>>> model2, Collections.emptyMap());
>>>>>>>> // Detects differences
>>>>>>>> final DiffModel diff = DiffService.doDiff(match);
>>>>>>>> // Merges all differences from model1 to model2
>>>>>>>> MergeService.merge(diff.getOwnedElements());
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Laurent
>>>>>>>>
>>>>>>>> Mark Melia a écrit :
>>>>>>>>> Hi all,
>>>>>>>>>
>>>>>>>>> I am looking for something to merge two ecore models which are
>>>>>>>>> defined according to the same metamodel - does anyone have an
>>>>>>>>> idea. I would ideally like to use an ant script for the merge.
>>>>>>>>>
>>>>>>>>> I have been looking at EMF Compare but cant access the
>>>>>>>>> developer guide, maybe someone can tell me if this would suit
>>>>>>>>> my needs - possibly point me to a tutorial.
>>>>>>>>>
>>>>>>>>> Thanks for your help,
>>>>>>>>> Mark
>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
Previous Topic:No notifications for changes to model objects after saving a JpoxResource
Next Topic:[Teneo] NoSuchMethodError exception when trying to add element to an EList
Goto Forum:
  


Current Time: Tue Jul 27 00:47:00 GMT 2021

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

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

Back to the top