Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Unable to load model which was created using the same emf(Using Featuremaps and derived, transient and volatile)
Unable to load model which was created using the same emf [message #987520] Mon, 26 November 2012 23:04 Go to next message
Ravikanth Somayaji is currently offline Ravikanth SomayajiFriend
Messages: 49
Registered: July 2009
Location: Oxford
Member
When xsd:group are converted to ecore models they are translated into EFeatureMapEntry.

The problem is that I cannot load the model which I created from the same meta-model.

Can anyone please advice?

Model trying to load - My.sample
Meta-model - My.ecore

I would appreciate any help whatsoever.
  • Attachment: My.ecore
    (Size: 4.16KB, Downloaded 251 times)
  • Attachment: My.sample
    (Size: 0.09KB, Downloaded 265 times)
Re: Unable to load model which was created using the same emf [message #987559 is a reply to message #987520] Tue, 27 November 2012 07:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Ravikanth,

Comments below.

On 27/11/2012 12:04 AM, Ravikanth Somayaji wrote:
> When xsd:group are converted to ecore models they are translated into EFeatureMapEntry.
A list of such things.
>
> The problem is that I cannot load the model which I created from the same meta-model.
What's going wrong?
>
> Can anyone please advice?
What exactly did you do to load the model?
>
> Model trying to load - My.sample
> Meta-model - My.ecore
>
> I would appreciate any help whatsoever.
You've invoked "Generate Test Code" and looked at how the generated
XyzExample.java does loading and saving?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Unable to load model which was created using the same emf [message #987598 is a reply to message #987559] Tue, 27 November 2012 10:02 Go to previous messageGo to next message
Ravikanth Somayaji is currently offline Ravikanth SomayajiFriend
Messages: 49
Registered: July 2009
Location: Oxford
Member
Thanks for you response, Ed.

>What's going wrong?
The generated EMF editor fails to open up the model which it previously created.

>What exactly did you do to load the model?
Invoke the editor. The model contains DocumentRoot->Ref->Mem
When only Ref is added, the editor opens up ok, however, when Mem is added the editor goes berserk and complains of FeatureNotFoundException.

>You've invoked "Generate Test Code" and looked at how the generated
XyzExample.java does loading and saving?
Yes - however, this does not add Mem to the model in the example, when I modify to add Mem, the loading fails with the same exception.

Cheers,
Ravi
Re: Unable to load model which was created using the same emf [message #987618 is a reply to message #987598] Tue, 27 November 2012 10:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Ravi,

Comments below.

On 27/11/2012 11:02 AM, Ravikanth Somayaji wrote:
> Thanks for you response, Ed.
>
>> What's going wrong?
> The generated EMF editor fails to open up the model which it
> previously created.
>> What exactly did you do to load the model?
> Invoke the editor. The model contains DocumentRoot->Ref->Mem When only
> Ref is added, the editor opens up ok, however, when Mem is added the
> editor goes berserk and complains of FeatureNotFoundException.
Are you sure that your generated resource factory is being used to load
the resource? Set a breakpoint in the generated resource factory's
createResource method to find out.
>
>> You've invoked "Generate Test Code" and looked at how the generated
> XyzExample.java does loading and saving?
You weren't specific about your scenario, so I couldn't be sure if you
were running in the IDE or trying to do something stand alone.
> Yes - however, this does not add Mem to the model in the example, when
> I modify to add Mem, the loading fails with the same exception.
Hmmm, that's definitely using your generated resource factory...

Looking more closely at the attachments, did you do something to make
the nsPrefix be the empty string? That looks like the source of the
problem, i.e., your nested element is implicitly namespace qualified but
that doesn't conform to the schema (where it looks like Mem is a local
element declaration that should have no namespace qualification in the
instance XML).
>
> Cheers,
> Ravi


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Unable to load model which was created using the same emf [message #987624 is a reply to message #987618] Tue, 27 November 2012 10:58 Go to previous messageGo to next message
Ravikanth Somayaji is currently offline Ravikanth SomayajiFriend
Messages: 49
Registered: July 2009
Location: Oxford
Member
>>Looking more closely at the attachments, did you do something to make
the nsPrefix be the empty string? That looks like the source of the
problem, i.e., your nested element is implicitly namespace qualified but
that doesn't conform to the schema (where it looks like Mem is a local
element declaration that should have no namespace qualification in the
instance XML).


Yes, I have cleared the nsPrefix - as my existing xml don't have any prefix and I'd like to keep it that way. But, now that you mentioned it, I'm beginning to realise that might be the problem.

Do you reckon, I change the xsd to add elementFormDefault="qualified" in the xsd:schema declaration or can I change something in the ecore or genmodel to let the generator consider this scenario?

I appreciate your interest.

Cheers
Ravi
Re: Unable to load model which was created using the same emf [message #987625 is a reply to message #987624] Tue, 27 November 2012 11:04 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Ravi,

Comments below.

On 27/11/2012 11:58 AM, Ravikanth Somayaji wrote:
>>> Looking more closely at the attachments, did you do something to make
> the nsPrefix be the empty string? That looks like the source of the
> problem, i.e., your nested element is implicitly namespace qualified but
> that doesn't conform to the schema (where it looks like Mem is a local
> element declaration that should have no namespace qualification in the
> instance XML).
>
>
> Yes, I have cleared the nsPrefix - as my existing xml don't have any
> prefix and I'd like to keep it that way. But, now that you mentioned
> it, I'm beginning to realise that might be the problem.
Definitely.
>
> Do you reckon, I change the xsd to add elementFormDefault="qualified"
> in the xsd:schema declaration or can I change something in the ecore
> or genmodel to let the generator consider this scenario?
Yes, you should make sure your schema specifies the right syntax for the
instances, so that should do the trick.
>
> I appreciate your interest.
>
> Cheers
> Ravi


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Unable to load model which was created using the same emf [message #987731 is a reply to message #987625] Tue, 27 November 2012 19:22 Go to previous message
Ravikanth Somayaji is currently offline Ravikanth SomayajiFriend
Messages: 49
Registered: July 2009
Location: Oxford
Member
>Yes, you should make sure your schema specifies the right syntax for the
instances, so that should do the trick.

Thanks, That works well.

Appreciate your responses.

Ravi
Previous Topic:Schema location for cascaded ecore models "initialize by loading"
Next Topic:[CDO] CDO 4.1 & 4.2 compatibility with older Eclipse versions
Goto Forum:
  


Current Time: Fri Apr 19 06:46:00 GMT 2024

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

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

Back to the top