Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Use Texo and EMF genmodel together(error initializing Literals)
Use Texo and EMF genmodel together [message #1060110] Thu, 23 May 2013 07:22 Go to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
I got two packages (ecores).
one for my data model and one for my controller.
the data model gets generated with TEXO, and the controller shall be generated with EMF genmodel.
all fine till here (generating works fine and after managing the includes no errors are shown but in the xxxPackage class.
i was able to resolve the errors (at least none are shown in problems dialog.)

when i finally run the code i get the following error:

java.lang.NoClassDefFoundError: Could not initialize class controller.ControllerPackage$Literals


any ideas why?
NOTE: there are no references from the controller to the data model itself (only other direction)
so the controller should not care about the data model! (actually i did not expect any problems with the controller but some with the datamodel, which could be tricky due inclusion of an EMF package in a generated TEXO package (it seems they get initialized different)
Re: Use Texo and EMF genmodel together [message #1060113 is a reply to message #1060110] Thu, 23 May 2013 07:35 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ludwig,
Hmm, can you show more of the stacktrace, this part does not show which class can not be found. Are you generating the
EMF model and the texo model classes in different plugins/projects (that is safer I think).

I noticed another post of you on the ecoretools forum. I don't watch that forum, it is better to the use the EMFT forum
for Texo questions:
http://www.eclipse.org/forums/index.php/f/19/

but will reply to your post on the ecoretools forum shortly.

gr. Martin

On 05/23/2013 09:22 AM, Ludwig Moser wrote:
> I got two packages (ecores).
> one for my data model and one for my controller.
> the data model gets generated with TEXO, and the controller shall be generated with EMF genmodel.
> all fine till here (generating works fine and after managing the includes no errors are shown but in the xxxPackage class.
> i was able to resolve the errors (at least none are shown in problems dialog.)
>
> when i finally run the code i get the following error:
>
> java.lang.NoClassDefFoundError: Could not initialize class controller.ControllerPackage$Literals
>
> any ideas why?
> NOTE: there are no references from the controller to the data model itself (only other direction)
> so the controller should not care about the data model! (actually i did not expect any problems with the controller but
> some with the datamodel, which could be tricky due inclusion of an EMF package in a generated TEXO package (it seems
> they get initialized different)


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: Use Texo and EMF genmodel together [message #1060148 is a reply to message #1060113] Thu, 23 May 2013 10:28 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
so my problem now is, that i tried to resolve the errors and now nothing is working anymore Sad
i put everything into one ecore again and try to generate it with texo, but it skips me some eclasses (which are a construct to represent a hashmap - this is my main problem here, as texo does not generate function, and now it even skips generating those classes)

here a crop of my ecore, the selected classes are ignored(not generated) by texo
index.php/fa/15020/0/

PS: in which part of the forum do you read texo threads? EMF / EMFT / EMF Tools
Re: Use Texo and EMF genmodel together [message #1060155 is a reply to message #1060148] Thu, 23 May 2013 11:08 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ludwig,
I read EMF and EMFT.

These classes are skipped as Texo generates parameterized Map declarations in the java classes, so there is no need for
a separate java class to represent a map entry.

gr. Martin

On 05/23/2013 12:28 PM, Ludwig Moser wrote:
> so my problem now is, that i tried to resolve the errors and now nothing is working anymore :(
> i put everything into one ecore again and try to generate it with texo, but it skips me some eclasses (which are a construct to represent a hashmap - this is my main problem here, as texo does not generate function, and now it even skips generating those classes)
>
> here a crop of my ecore, the selected classes are ignored(not generated) by texo
>
>
> PS: in which part of the forum do you read texo threads? EMF / EMFT / EMF Tools
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: Use Texo and EMF genmodel together [message #1060305 is a reply to message #1060155] Fri, 24 May 2013 06:22 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
but its an simple Map, not an EMap, which would report changes
or do i miss something at this point? can i listen for changes in a normal (LinkedHashMap) map?
Re: Use Texo and EMF genmodel together [message #1060317 is a reply to message #1060305] Fri, 24 May 2013 06:48 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ludwig,
Texo (in general java with standard ORM's) doesn't support listening to changes to objects/lists etc. You can listen to
changes when persisting data (there are several types of JPA listener implementations for that).

EMF generated code on the other hand allows you to register/listen to changes directly in objects. This makes sense as
the EMF objects are used in the UI layer to update views/screens when the underlying model changes.

Texo objects are not running in the UI layer so there instant notifications have no/less value. On the persistence layer
it often has more functional sense to listen to persistence events (onsave, ondelete, aftercommit). These events are
more on transaction level and are fired by the ORM and not by the objects themselves.

Hope my short explaination helps a bit..

gr. Martin

On 05/24/2013 08:22 AM, Ludwig Moser wrote:
> but its an simple Map, not an EMap, which would report changes
> or do i miss something at this point? can i listen for changes in a normal (LinkedHashMap) map?


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:Trying to reference EClassifier in my model
Next Topic:Clean Generated
Goto Forum:
  


Current Time: Thu Mar 28 13:42:45 GMT 2024

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

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

Back to the top