Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Error while programmatically mergin two models
Error while programmatically mergin two models [message #137000] Tue, 09 June 2009 08:45 Go to next message
Josip Maras is currently offline Josip MarasFriend
Messages: 41
Registered: July 2009
Member
Hi,

Can anyone help me with the following problem:

I'm trying to merge two models in code:

//START CODE
final ResourceSet resourceSet = new ResourceSetImpl();
final EObject model1 = ModelUtils.load
(new File("C:/uml/phpWithAttributes.uml"), resourceSet);

final EObject model2 = ModelUtils.load
(new File("C:/uml/phpWithAttributes1.uml"), resourceSet);

final MatchModel match = MatchService.doMatch
(model1, model2, Collections.<String, Object> emptyMap());

final DiffModel diff = DiffService.doDiff(match, false);

MergeService.merge(new ArrayList<DiffElement>(diff.getOwnedElements()),
true);
//END CODE

I get the following exception:
org.eclipse.emf.compare.diff.metamodel.impl.DiffModelImpl cannot be cast
to org.eclipse.emf.compare.diff.metamodel.ModelInputSnapshot

I would be grateful for any ideas on how to resolve this issue.

Thank you
Re: Error while programmatically mergin two models [message #137064 is a reply to message #137000] Tue, 09 June 2009 16:23 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090001040904080400070104
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Josip,

The error message is pretty straightforward. You cast something you
shouldn't be :).

The line that triggered this is not part of what you copy pasted here.
You have somewhere in your code "(ModelInputSnapshot)aVariable", yet
"aVariable" is of type "DiffModel" and DiffModel is not a subclass of
ModelInputSnapshot ... thus cannot be cast to it.

You can take a look at org.eclipse.emf.compare.examples.standalone to
see an example of how to create and save to disk a ModelInputSnapshot (I
believe this is what you're trying to achieve). If you cannot fix this
error, please copy paste here the line that triggers your exception and
the few lines above it, as well as the few first lines of your exception
so that I can see the line numbers.

Cheers,

Laurent Goubet
Obeo

Josip Maras a
Re: Error while programmatically mergin two models [message #137084 is a reply to message #137064] Wed, 10 June 2009 06:30 Go to previous messageGo to next message
Josip Maras is currently offline Josip MarasFriend
Messages: 41
Registered: July 2009
Member
Hi Laurent, thank you for your response!

Unfortunately, i haven't done any mysterious casting. This is the whole
code.

I'm building a tool to RE php, html and JavaScript into models matching
Connalen's web UML extensions. And these two models (phpWithAttributes.uml
and phpWithAttributes1.uml) are something that my code generates. I'm not
sure but maybe i haven't cleaned up some resources in the model generation
phase - i'll have to check. But my generated models are ok when read from
Eclipse.

The exception is thrown from

MergeService.merge(new ArrayList<DiffElement>(diff.getOwnedElements()),
true);

Thank you for your help

laurent Goubet wrote:

> Hi Josip,

> The error message is pretty straightforward. You cast something you
> shouldn't be :).

> The line that triggered this is not part of what you copy pasted here.
> You have somewhere in your code "(ModelInputSnapshot)aVariable", yet
> "aVariable" is of type "DiffModel" and DiffModel is not a subclass of
> ModelInputSnapshot ... thus cannot be cast to it.

> You can take a look at org.eclipse.emf.compare.examples.standalone to
> see an example of how to create and save to disk a ModelInputSnapshot (I
> believe this is what you're trying to achieve). If you cannot fix this
> error, please copy paste here the line that triggers your exception and
> the few lines above it, as well as the few first lines of your exception
> so that I can see the line numbers.

> Cheers,

> Laurent Goubet
> Obeo

> Josip Maras a écrit :
>>
>> Hi,
>>
>> Can anyone help me with the following problem:
>>
>> I'm trying to merge two models in code:
>>
>> //START CODE
>> final ResourceSet resourceSet = new ResourceSetImpl();
>> final EObject model1 = ModelUtils.load
>> (new File("C:/uml/phpWithAttributes.uml"), resourceSet);
>>
>> final EObject model2 = ModelUtils.load
>> (new File("C:/uml/phpWithAttributes1.uml"), resourceSet);
>>
>> final MatchModel match = MatchService.doMatch
>> (model1, model2, Collections.<String, Object> emptyMap());
>>
>> final DiffModel diff = DiffService.doDiff(match, false);
>> MergeService.merge(new
>> ArrayList<DiffElement>(diff.getOwnedElements()), true);
>> //END CODE
>>
>> I get the following exception:
>> org.eclipse.emf.compare.diff.metamodel.impl.DiffModelImpl cannot be cast
>> to org.eclipse.emf.compare.diff.metamodel.ModelInputSnapshot
>>
>> I would be grateful for any ideas on how to resolve this issue.
>>
>> Thank you
>>
Re: Error while programmatically mergin two models [message #137095 is a reply to message #137084] Wed, 10 June 2009 09:22 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070801060300030006050408
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Josip,

This might come from a problem within the merge code then ... Could you
copy paste the whole exception stack trace?

Laurent Goubet
Obeo

Josip Maras a
Re: Error while programmatically mergin two models [message #137106 is a reply to message #137095] Wed, 10 June 2009 09:31 Go to previous messageGo to next message
Josip Maras is currently offline Josip MarasFriend
Messages: 41
Registered: July 2009
Member
Hi, here it goes:

org.eclipse.emf.compare.diff.metamodel.impl.DiffModelImpl cannot be cast
to org.eclipse.emf.compare.diff.metamodel.ModelInputSnapshot at
org.eclipse.emf.compare.diff.merge.api.DefaultMerger.findRig htResource(DefaultMerger.java:163)
at
org.eclipse.emf.compare.diff.merge.internal.impl.ModelElemen tChangeLeftTargetMerger.undoInTarget(ModelElementChangeLeftT argetMerger.java:75)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)
at
org.eclipse.emf.compare.diff.merge.internal.impl.DiffGroupMe rger.undoInTarget(DiffGroupMerger.java:48)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)
at
umlGeneratorTest.UmlGeneratorTest.testGenerateUml(UmlGenerat orTest.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38Cla ssRunner.java:91)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:45)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)

Thanks
Re: Error while programmatically mergin two models [message #137118 is a reply to message #137106] Wed, 10 June 2009 09:58 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000802030600070606070901
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Josip,

Something I didn't realize before but ... ModelInputSnapshot is a class
that doesn't exist anymore, since 0.9M3 if I am not mistaken. moreover,
DefaultMerger.findRightResource() is deprecated in the latest CVS code.
The 0.9 stream is compatible with the same Eclipse versions as the 0.8
was (see http://wiki.eclipse.org/EMF_Compare#Compatibility ). Can you
try with the latest release of EMF Compare or is there a reason why you
didn't update?

Laurent Goubet
Obeo

Josip Maras a
Re: Error while programmatically mergin two models [message #137168 is a reply to message #137118] Thu, 11 June 2009 15:56 Go to previous messageGo to next message
Josip Maras is currently offline Josip MarasFriend
Messages: 41
Registered: July 2009
Member
Hi Laurent,

I've lost a couple of hours and it seems that i'm doing something wrong
while generating diagrams. If i use the same code on the diagrams i've
created in Eclipse (by hand i add a couple of classes...) everything
works, but if i load my diagrams it crashes with that DiffModelImpl cannot
be cast to ...

But interestingly even my generated diagrams can be compared from the
Eclipse UI. It will be a looong debugging session.

Thank you for everything

laurent Goubet wrote:

> Josip,

> Something I didn't realize before but ... ModelInputSnapshot is a class
> that doesn't exist anymore, since 0.9M3 if I am not mistaken. moreover,
> DefaultMerger.findRightResource() is deprecated in the latest CVS code.
> The 0.9 stream is compatible with the same Eclipse versions as the 0.8
> was (see http://wiki.eclipse.org/EMF_Compare#Compatibility ). Can you
> try with the latest release of EMF Compare or is there a reason why you
> didn't update?

> Laurent Goubet
> Obeo
Re: Error while programmatically mergin two models [message #137505 is a reply to message #137118] Tue, 23 June 2009 08:59 Go to previous messageGo to next message
Josip Maras is currently offline Josip MarasFriend
Messages: 41
Registered: July 2009
Member
Hi,

I've updated to version 1.0, and now i get the following exception:

java.lang.NullPointerException at
org.eclipse.emf.compare.diff.internal.merge.impl.ModelElemen tChangeLeftTargetMerger.undoInTarget(ModelElementChangeLeftT argetMerger.java:75)at
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)at
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)at
org.eclipse.emf.compare.diff.internal.merge.impl.DiffGroupMe rger.undoInTarget(DiffGroupMerger.java:48)at
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)at
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)

Could this issue be happening due to the fact that both uml models are
using the same external profile file defining all stereotypes.

Thank you
Re: Error while programmatically mergin two models [message #137516 is a reply to message #137505] Tue, 23 June 2009 09:26 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060606030203080801060407
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Josip,

This exception would mean EMF Compare couldn't find the Resource of your
right model ... Are you using a code as shown in
org.eclipse.emf.compare.examples.standalone.ExampleLauncher or equivalent?

if you are, could you raise a bugzilla with your code and the two models
you compare so that I can try and reproduce?

Laurent Goubet
Obeo

Josip Maras a
Re: Error while programmatically mergin two models [message #137528 is a reply to message #137516] Tue, 23 June 2009 12:40 Go to previous message
Josip Maras is currently offline Josip MarasFriend
Messages: 41
Registered: July 2009
Member
Hi Laurent, thank you for all your help!

I've uploaded the code and the files to:

www.fesb.hr/~jomaras/data/testFiles.rar - one profile, two uml models and
two class diagrams

www.fesb.hr/~jomaras/data/callingCode.java

Thank you

laurent Goubet wrote:

> Hi Josip,

> This exception would mean EMF Compare couldn't find the Resource of your
> right model ... Are you using a code as shown in
> org.eclipse.emf.compare.examples.standalone.ExampleLauncher or equivalent?

> if you are, could you raise a bugzilla with your code and the two models
> you compare so that I can try and reproduce?

> Laurent Goubet
> Obeo

> Josip Maras a écrit :
>> Hi,
>>
>> I've updated to version 1.0, and now i get the following exception:
>>
>> java.lang.NullPointerException at
>>
org.eclipse.emf.compare.diff.internal.merge.impl.ModelElemen tChangeLeftTargetMerger.undoInTarget(ModelElementChangeLeftT argetMerger.java:75)at
>>
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)at
>>
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)at
>>
org.eclipse.emf.compare.diff.internal.merge.impl.DiffGroupMe rger.undoInTarget(DiffGroupMerger.java:48)at
>>
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)at
>>
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)
>>
>>
>> Could this issue be happening due to the fact that both uml models are
>> using the same external profile file defining all stereotypes.
>>
>> Thank you
>>
Re: Error while programmatically mergin two models [message #621004 is a reply to message #137000] Tue, 09 June 2009 16:23 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090001040904080400070104
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Josip,

The error message is pretty straightforward. You cast something you
shouldn't be :).

The line that triggered this is not part of what you copy pasted here.
You have somewhere in your code "(ModelInputSnapshot)aVariable", yet
"aVariable" is of type "DiffModel" and DiffModel is not a subclass of
ModelInputSnapshot ... thus cannot be cast to it.

You can take a look at org.eclipse.emf.compare.examples.standalone to
see an example of how to create and save to disk a ModelInputSnapshot (I
believe this is what you're trying to achieve). If you cannot fix this
error, please copy paste here the line that triggers your exception and
the few lines above it, as well as the few first lines of your exception
so that I can see the line numbers.

Cheers,

Laurent Goubet
Obeo

Josip Maras a
Re: Error while programmatically mergin two models [message #621006 is a reply to message #137064] Wed, 10 June 2009 06:30 Go to previous message
Josip Maras is currently offline Josip MarasFriend
Messages: 41
Registered: July 2009
Member
Hi Laurent, thank you for your response!

Unfortunately, i haven't done any mysterious casting. This is the whole
code.

I'm building a tool to RE php, html and JavaScript into models matching
Connalen's web UML extensions. And these two models (phpWithAttributes.uml
and phpWithAttributes1.uml) are something that my code generates. I'm not
sure but maybe i haven't cleaned up some resources in the model generation
phase - i'll have to check. But my generated models are ok when read from
Eclipse.

The exception is thrown from

MergeService.merge(new ArrayList<DiffElement>(diff.getOwnedElements()),
true);

Thank you for your help

laurent Goubet wrote:

> Hi Josip,

> The error message is pretty straightforward. You cast something you
> shouldn't be :).

> The line that triggered this is not part of what you copy pasted here.
> You have somewhere in your code "(ModelInputSnapshot)aVariable", yet
> "aVariable" is of type "DiffModel" and DiffModel is not a subclass of
> ModelInputSnapshot ... thus cannot be cast to it.

> You can take a look at org.eclipse.emf.compare.examples.standalone to
> see an example of how to create and save to disk a ModelInputSnapshot (I
> believe this is what you're trying to achieve). If you cannot fix this
> error, please copy paste here the line that triggers your exception and
> the few lines above it, as well as the few first lines of your exception
> so that I can see the line numbers.

> Cheers,

> Laurent Goubet
> Obeo

> Josip Maras a écrit :
>>
>> Hi,
>>
>> Can anyone help me with the following problem:
>>
>> I'm trying to merge two models in code:
>>
>> //START CODE
>> final ResourceSet resourceSet = new ResourceSetImpl();
>> final EObject model1 = ModelUtils.load
>> (new File("C:/uml/phpWithAttributes.uml"), resourceSet);
>>
>> final EObject model2 = ModelUtils.load
>> (new File("C:/uml/phpWithAttributes1.uml"), resourceSet);
>>
>> final MatchModel match = MatchService.doMatch
>> (model1, model2, Collections.<String, Object> emptyMap());
>>
>> final DiffModel diff = DiffService.doDiff(match, false);
>> MergeService.merge(new
>> ArrayList<DiffElement>(diff.getOwnedElements()), true);
>> //END CODE
>>
>> I get the following exception:
>> org.eclipse.emf.compare.diff.metamodel.impl.DiffModelImpl cannot be cast
>> to org.eclipse.emf.compare.diff.metamodel.ModelInputSnapshot
>>
>> I would be grateful for any ideas on how to resolve this issue.
>>
>> Thank you
>>
Re: Error while programmatically mergin two models [message #621007 is a reply to message #137084] Wed, 10 June 2009 09:22 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070801060300030006050408
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Josip,

This might come from a problem within the merge code then ... Could you
copy paste the whole exception stack trace?

Laurent Goubet
Obeo

Josip Maras a
Re: Error while programmatically mergin two models [message #621008 is a reply to message #137095] Wed, 10 June 2009 09:31 Go to previous message
Josip Maras is currently offline Josip MarasFriend
Messages: 41
Registered: July 2009
Member
Hi, here it goes:

org.eclipse.emf.compare.diff.metamodel.impl.DiffModelImpl cannot be cast
to org.eclipse.emf.compare.diff.metamodel.ModelInputSnapshot at
org.eclipse.emf.compare.diff.merge.api.DefaultMerger.findRig htResource(DefaultMerger.java:163)
at
org.eclipse.emf.compare.diff.merge.internal.impl.ModelElemen tChangeLeftTargetMerger.undoInTarget(ModelElementChangeLeftT argetMerger.java:75)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)
at
org.eclipse.emf.compare.diff.merge.internal.impl.DiffGroupMe rger.undoInTarget(DiffGroupMerger.java:48)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)
at
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)
at
umlGeneratorTest.UmlGeneratorTest.testGenerateUml(UmlGenerat orTest.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38Cla ssRunner.java:91)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:45)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)

Thanks
Re: Error while programmatically mergin two models [message #621009 is a reply to message #137106] Wed, 10 June 2009 09:58 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000802030600070606070901
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Josip,

Something I didn't realize before but ... ModelInputSnapshot is a class
that doesn't exist anymore, since 0.9M3 if I am not mistaken. moreover,
DefaultMerger.findRightResource() is deprecated in the latest CVS code.
The 0.9 stream is compatible with the same Eclipse versions as the 0.8
was (see http://wiki.eclipse.org/EMF_Compare#Compatibility ). Can you
try with the latest release of EMF Compare or is there a reason why you
didn't update?

Laurent Goubet
Obeo

Josip Maras a
Re: Error while programmatically mergin two models [message #621013 is a reply to message #137118] Thu, 11 June 2009 15:56 Go to previous message
Josip Maras is currently offline Josip MarasFriend
Messages: 41
Registered: July 2009
Member
Hi Laurent,

I've lost a couple of hours and it seems that i'm doing something wrong
while generating diagrams. If i use the same code on the diagrams i've
created in Eclipse (by hand i add a couple of classes...) everything
works, but if i load my diagrams it crashes with that DiffModelImpl cannot
be cast to ...

But interestingly even my generated diagrams can be compared from the
Eclipse UI. It will be a looong debugging session.

Thank you for everything

laurent Goubet wrote:

> Josip,

> Something I didn't realize before but ... ModelInputSnapshot is a class
> that doesn't exist anymore, since 0.9M3 if I am not mistaken. moreover,
> DefaultMerger.findRightResource() is deprecated in the latest CVS code.
> The 0.9 stream is compatible with the same Eclipse versions as the 0.8
> was (see http://wiki.eclipse.org/EMF_Compare#Compatibility ). Can you
> try with the latest release of EMF Compare or is there a reason why you
> didn't update?

> Laurent Goubet
> Obeo
Re: Error while programmatically mergin two models [message #621043 is a reply to message #137118] Tue, 23 June 2009 08:59 Go to previous message
Josip Maras is currently offline Josip MarasFriend
Messages: 41
Registered: July 2009
Member
Hi,

I've updated to version 1.0, and now i get the following exception:

java.lang.NullPointerException at
org.eclipse.emf.compare.diff.internal.merge.impl.ModelElemen tChangeLeftTargetMerger.undoInTarget(ModelElementChangeLeftT argetMerger.java:75)at
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)at
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)at
org.eclipse.emf.compare.diff.internal.merge.impl.DiffGroupMe rger.undoInTarget(DiffGroupMerger.java:48)at
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)at
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)

Could this issue be happening due to the fact that both uml models are
using the same external profile file defining all stereotypes.

Thank you
Re: Error while programmatically mergin two models [message #621044 is a reply to message #137505] Tue, 23 June 2009 09:26 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060606030203080801060407
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Josip,

This exception would mean EMF Compare couldn't find the Resource of your
right model ... Are you using a code as shown in
org.eclipse.emf.compare.examples.standalone.ExampleLauncher or equivalent?

if you are, could you raise a bugzilla with your code and the two models
you compare so that I can try and reproduce?

Laurent Goubet
Obeo

Josip Maras a
Re: Error while programmatically mergin two models [message #621045 is a reply to message #137516] Tue, 23 June 2009 12:40 Go to previous message
Josip Maras is currently offline Josip MarasFriend
Messages: 41
Registered: July 2009
Member
Hi Laurent, thank you for all your help!

I've uploaded the code and the files to:

www.fesb.hr/~jomaras/data/testFiles.rar - one profile, two uml models and
two class diagrams

www.fesb.hr/~jomaras/data/callingCode.java

Thank you

laurent Goubet wrote:

> Hi Josip,

> This exception would mean EMF Compare couldn't find the Resource of your
> right model ... Are you using a code as shown in
> org.eclipse.emf.compare.examples.standalone.ExampleLauncher or equivalent?

> if you are, could you raise a bugzilla with your code and the two models
> you compare so that I can try and reproduce?

> Laurent Goubet
> Obeo

> Josip Maras a écrit :
>> Hi,
>>
>> I've updated to version 1.0, and now i get the following exception:
>>
>> java.lang.NullPointerException at
>>
org.eclipse.emf.compare.diff.internal.merge.impl.ModelElemen tChangeLeftTargetMerger.undoInTarget(ModelElementChangeLeftT argetMerger.java:75)at
>>
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)at
>>
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)at
>>
org.eclipse.emf.compare.diff.internal.merge.impl.DiffGroupMe rger.undoInTarget(DiffGroupMerger.java:48)at
>>
org.eclipse.emf.compare.diff.merge.service.MergeService.doMe rge(MergeService.java:172)at
>>
org.eclipse.emf.compare.diff.merge.service.MergeService.merg e(MergeService.java:136)
>>
>>
>> Could this issue be happening due to the fact that both uml models are
>> using the same external profile file defining all stereotypes.
>>
>> Thank you
>>
Previous Topic:How to add EMF Index Plugins?
Next Topic:How to add EMF Index Plugins?
Goto Forum:
  


Current Time: Fri Dec 13 09:30:19 GMT 2024

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

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

Back to the top