|
Re: Loading an EMFCompare differences model [message #526702 is a reply to message #526672] |
Mon, 12 April 2010 16:13 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Hi Sebasián,
I assume that you are running your code outside of Eclipse? In such a
case you have to register the used packages manually because the Eclipse
registry isn't present. Try this:
EPackage.Registry.INSTANCE.put(DiffPackage.eNS_URI, DiffPackage.eINSTANCE);
best regards,
Gilbert
Am 12.04.2010 16:53, schrieb jsebas85@gmail.com:
> Hi. After comparing 2 versions of a model, I get the differences model
> and save it as an XMI file. Now I want to load this model to navigate it
> using EMF API, but I'm getting this error:
>
> Exception in thread "main"
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos
> ticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException:
> Package with uri 'http://www.eclipse.org/emf/compare/diff/1.1' not
> found. (file:/C:/eclipseGalileo/workspace/org.eclipse.emf.examples.
> library/model/result2.xmi, 2, 296)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe
> mandLoadException(ResourceSetImpl.java:315)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
> adHelper(ResourceSetImpl.java:274)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou
> rce(ResourceSetImpl.java:397)
>
> So basically it says that diff metamodel can't be found. Do I need to
> have a diff metamodel instance in the workspace for being able to do
> what I want to do? If this is the case, where can I get this resources?
>
> Thanks in advance.
> Sebastián.
>
|
|
|
|
Re: Loading an EMFCompare differences model [message #526726 is a reply to message #526707] |
Mon, 12 April 2010 18:08 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Hi Sebastián,
> Actually, I'm running the code inside Eclipse, so it is not the case.
> Probably I would also have to register diff metamodel, but as I don't
> have a metamodel instance (an .ecore file in my workspace) I don't know
> how to do it.
Then the code line from my previous answer should do the trick anyway.
If the code doesn't compile then you need to add a dependency to the
org.eclipse.emf.compare.diff plugin.
best regards,
Gilbert
|
|
|
Re: Loading an EMFCompare differences model [message #526897 is a reply to message #526726] |
Tue, 13 April 2010 12:32 |
|
This is a multi-part message in MIME format.
--------------010907050506090407030906
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Hi Sebastián, Gilbert,
The line of code Gilbert pointed out is exactly what you need if you are
not using the default eclipse actions to load this model (ie, you create
the resource on the emfdiff path and then use EMF APIs to load it
instead of double clicking the emfdiff file in the workspace).
You'll need to add Gilbert's code _before_ creating and loading the EMF
resource.
However if you are using standard Eclipse actions to load the model
(double click in the workspace comes in mind), then what you encounter
is a bug.
Could you tell us which of these cases you're in?
Laurent Goubet
Obeo
Gilbert Mirenque wrote:
> Hi Sebastián,
>
>> Actually, I'm running the code inside Eclipse, so it is not the case.
>> Probably I would also have to register diff metamodel, but as I don't
>> have a metamodel instance (an .ecore file in my workspace) I don't know
>> how to do it.
>
> Then the code line from my previous answer should do the trick anyway.
> If the code doesn't compile then you need to add a dependency to the
> org.eclipse.emf.compare.diff plugin.
>
> best regards,
> Gilbert
--------------010907050506090407030906
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------010907050506090407030906--
|
|
|
|
|
Re: Loading an EMFCompare differences model [message #622461 is a reply to message #622459] |
Mon, 12 April 2010 18:08 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Hi Sebastián,
> Actually, I'm running the code inside Eclipse, so it is not the case.
> Probably I would also have to register diff metamodel, but as I don't
> have a metamodel instance (an .ecore file in my workspace) I don't know
> how to do it.
Then the code line from my previous answer should do the trick anyway.
If the code doesn't compile then you need to add a dependency to the
org.eclipse.emf.compare.diff plugin.
best regards,
Gilbert
|
|
|
Re: Loading an EMFCompare differences model [message #622464 is a reply to message #526726] |
Tue, 13 April 2010 12:32 |
|
This is a multi-part message in MIME format.
--------------010907050506090407030906
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Hi Sebastián, Gilbert,
The line of code Gilbert pointed out is exactly what you need if you are
not using the default eclipse actions to load this model (ie, you create
the resource on the emfdiff path and then use EMF APIs to load it
instead of double clicking the emfdiff file in the workspace).
You'll need to add Gilbert's code _before_ creating and loading the EMF
resource.
However if you are using standard Eclipse actions to load the model
(double click in the workspace comes in mind), then what you encounter
is a bug.
Could you tell us which of these cases you're in?
Laurent Goubet
Obeo
Gilbert Mirenque wrote:
> Hi Sebastián,
>
>> Actually, I'm running the code inside Eclipse, so it is not the case.
>> Probably I would also have to register diff metamodel, but as I don't
>> have a metamodel instance (an .ecore file in my workspace) I don't know
>> how to do it.
>
> Then the code line from my previous answer should do the trick anyway.
> If the code doesn't compile then you need to add a dependency to the
> org.eclipse.emf.compare.diff plugin.
>
> best regards,
> Gilbert
--------------010907050506090407030906
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------010907050506090407030906--
|
|
|
|
Powered by
FUDForum. Page generated in 0.03541 seconds