Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Re: In my model, Class not found or is abstract
Re: In my model, Class not found or is abstract [message #540814] Thu, 17 June 2010 12:33 Go 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.
--------------000605090900040001000302
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Maxime,

If I understand correctly, this is more of an EMF question than it is an
M2T question, I added the emf newsgroup to the to: list of this answer.

Laurent Goubet
Obeo

Maxime Lecourt wrote:
> Hi,
>
> I made a metamodel, where Items is my container EClass.
>
> part of the metamodel :
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="hla"
> nsURI="http://hla/1.0" nsPrefix="hla">
> <eClassifiers xsi:type="ecore:EClass" name="Items">
> <eStructuralFeatures xsi:type="ecore:EReference" name="entities"
> upperBound="-1"
> eType="#//HEntity" derived="true" containment="true"/>
> </eClassifiers>
>
> So after that I wanted to define a model
> <?xml version="1.0" encoding="UTF-8"?>
> <hla:Items xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:metamodel="http://www.example.org/metamodel"
> xsi:schemaLocation="http://www.example.org/metamodel metamodel/hla.ecore">
> </hla:Items>
>
>
> But I get "Class 'Items' is not found or is abstract". The most
> surprising is that it worked for a while.


--------------000605090900040001000302
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=
--------------000605090900040001000302--
Re: In my model, Class not found or is abstract [message #540853 is a reply to message #540814] Thu, 17 June 2010 13:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
I see the package's nsURI is "http://hla/1.0" but I don't see an xmlns
declaration for that (so the XML looks invalid) nor any other use of the
package's namespace (so the instance doesn't conform to the model).

Laurent Goubet wrote:
> Hi Maxime,
>
> If I understand correctly, this is more of an EMF question than it is
> an M2T question, I added the emf newsgroup to the to: list of this
> answer.
>
> Laurent Goubet
> Obeo
>
> Maxime Lecourt wrote:
>> Hi,
>>
>> I made a metamodel, where Items is my container EClass.
>>
>> part of the metamodel :
>> <?xml version="1.0" encoding="UTF-8"?>
>> <ecore:EPackage xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="hla"
>> nsURI="http://hla/1.0" nsPrefix="hla">
>> <eClassifiers xsi:type="ecore:EClass" name="Items">
>> <eStructuralFeatures xsi:type="ecore:EReference" name="entities"
>> upperBound="-1"
>> eType="#//HEntity" derived="true" containment="true"/>
>> </eClassifiers>
>>
>> So after that I wanted to define a model
>> <?xml version="1.0" encoding="UTF-8"?>
>> <hla:Items xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:metamodel="http://www.example.org/metamodel"
>> xsi:schemaLocation="http://www.example.org/metamodel
>> metamodel/hla.ecore">
>> </hla:Items>
>>
>>
>> But I get "Class 'Items' is not found or is abstract". The most
>> surprising is that it worked for a while.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: In my model, Class not found or is abstract [message #540876 is a reply to message #540814] Thu, 17 June 2010 14:22 Go to previous messageGo to next message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
I didn't find any tutorial or documentation regarding how to define a model (didn't know what to search for), do you know where I could find some ?

Until now I've been going by trial and error Embarrassed


One day I shall master M2T, but that day has yet to come...
Re: In my model, Class not found or is abstract [message #540952 is a reply to message #540876] Thu, 17 June 2010 17:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Maxime,

There's the EMF book. Other than that, you'll have to make due with
what's on the EMF documentation page.


Maxime Lecourt wrote:
> I didn't find any tutorial or documentation regarding how to define a
> model (didn't know what to search for), do you know where I could find
> some ?
>
> Until now I've been going by trial and error :blush:


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: In my model, Class not found or is abstract [message #541086 is a reply to message #540814] Fri, 18 June 2010 09:45 Go to previous messageGo to next message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
From the EMF documentation, there is a tutorial, that would generate a .genmodel file, java files, and finally a library file.

Isn't there a way to generate an empty model file directly from an ecore metamodel, that I can fill with my instances ?

The EMF 2003 book seem's JAVA oriented mostly, there are examples about how to generate JAVA code, it states you can use a XMI serializer, but not how to use it.


One day I shall master M2T, but that day has yet to come...
Re: In my model, Class not found or is abstract [message #541179 is a reply to message #541086] Fri, 18 June 2010 14:31 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Maxime,

From the context menu of an EClass you can invoke Create Dynamic
Instance... Both versions of the book talk about the resource framework
and how to use it; the 2nd edition has twice as much content and hence a
lot more detail.


Maxime Lecourt wrote:
> From the EMF documentation, there is a tutorial, that would generate a
> .genmodel file, java files, and finally a library file.
>
> Isn't there a way to generate an empty model file directly from an
> ecore metamodel, that I can fill with my instances ?
>
> The EMF 2003 book seem's JAVA oriented mostly, there are examples
> about how to generate JAVA code, it states you can use a XMI
> serializer, but not how to use it.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:DOM like fallback
Next Topic:Ecore as its own metamodel
Goto Forum:
  


Current Time: Fri Apr 19 23:40:56 GMT 2024

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

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

Back to the top