|
|
Re: EMF Compare Load model file [message #1010760 is a reply to message #1009478] |
Mon, 18 February 2013 07:43 |
serhat gezgin Messages: 243 Registered: January 2013 Location: Izmir |
Senior Member |
|
|
Hi Lourent,
i study my lesson :)and i can load ecore like resource but when i run
MatchModel match = MatchService.doMatch(model1, model2,
Collections.<String, Object> emptyMap());
this method i always get that Error;
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Sets
at org.eclipse.emf.compare.match.engine.GenericMatchScope.resolveAll(GenericMatchScope.java:191)
at org.eclipse.emf.compare.match.engine.DefaultMatchScope.resolveAll(DefaultMatchScope.java:79)
at org.eclipse.emf.compare.match.engine.GenericMatchScope.<init>(GenericMatchScope.java:78)
at org.eclipse.emf.compare.match.engine.DefaultMatchScope.<init>(DefaultMatchScope.java:56)
at org.eclipse.emf.compare.match.engine.DefaultMatchScopeProvider.<init>(DefaultMatchScopeProvider.java:76)
at org.eclipse.emf.compare.match.engine.MatchScopeProviderUtil.getScopeProvider(MatchScopeProviderUtil.java:82)
at org.eclipse.emf.compare.match.engine.GenericMatchEngine.modelMatch(GenericMatchEngine.java:515)
at org.eclipse.emf.compare.match.service.MatchService.doMatch(MatchService.java:155)
at javaBean.emfCompareDeneme.name(emfCompareDeneme.java:52)
at javaBean.emfCompareDeneme.main(emfCompareDeneme.java:68)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Sets
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 10 more
my function is;
// register XMI resource factory for all other extensions
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
Resource.Factory.Registry.DEFAULT_EXTENSION,
new XMIResourceFactoryImpl());
ResourceSet resourceSet1 = new ResourceSetImpl();
ResourceSet resourceSet2 = new ResourceSetImpl();
String xmi1 = "src-gen/Case5.ecore";
String xmi2 = "src-gen/Case2.ecore";
File file1 = new File(xmi1);
File file2 = new File(xmi2);
// Loading models
EObject model1 = ModelUtils.load(file1, resourceSet1);
EObject model2 = ModelUtils.load(file2, resourceSet2);
URI uri1 = URI.createFileURI("src-gen/Case5.ecore");
URI uri2 = URI.createFileURI("src-gen/Case2.ecore");
// Matching model elements
MatchModel match = MatchService.doMatch(model1, model2,
Collections.<String, Object> emptyMap());
// Computing differences
DiffModel diff = DiffService.doDiff(match, false);
// Merges all differences from model1 to model2
List<DiffElement> differences = new ArrayList<DiffElement>(
diff.getOwnedElements());
// MergeService.merge(differences, true);
for (DiffElement diffElement : differences) {
System.out.println(diffElement.toString());
}
this method is true or Where I'm doing wrong ?
Regards,
|
|
|
Re: EMF Compare Load model file [message #1010783 is a reply to message #1010760] |
Mon, 18 February 2013 08:28 |
|
Hi Serhat,
Part of your training as a student in computer science is also to try and solve issues on your own : in a corporate environment, you'll face a number of wildly different issues that will require solving. Issues like these relating to dependencies are not something you should get blocked with so fast. Learning how to efficiently use google to find related information and adapt it to your case should be one of your priorities .
With that in mind, if you use a query such as "EMF Compare" followed by the error message on google, the first few results relate to a very close issue : http://www.eclipse.org/forums/index.php/t/452425/ . Though the error is not exactly the same (well, it is, but for EMF Compare 2), the answer and solution are the same : EMF Compare depends on Google Guava, which can be installed from the following update site http://download.eclipse.org/tools/orbit/downloads/drops/R20130118183705/ . Note that we depend on guava 10 explicitely, do not install Guava 12! In the "install new software..." dialog, this is done by unchecking the "show only the latest version of available software" checkbox.
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.01775 seconds