|
Re: Error while programmatically mergin two models [message #137064 is a reply to message #137000] |
Tue, 09 June 2009 16:23 |
|
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 |
Josip Maras 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 |
|
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 #137118 is a reply to message #137106] |
Wed, 10 June 2009 09:58 |
|
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 #137516 is a reply to message #137505] |
Tue, 23 June 2009 09:26 |
|
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 #621004 is a reply to message #137000] |
Tue, 09 June 2009 16:23 |
|
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 |
Josip Maras 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 |
|
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 #621009 is a reply to message #137106] |
Wed, 10 June 2009 09:58 |
|
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 #621044 is a reply to message #137505] |
Tue, 23 June 2009 09:26 |
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.02790 seconds