Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [TENEO] No annotated model element present
[TENEO] No annotated model element present [message #90777] |
Thu, 19 July 2007 12:24 |
Eclipse User |
|
|
|
Originally posted by: doux.guil.gmail.com
Hi,
I'm always experiencing problems to add models corresponding to my
meta-model in Teneo.
If I create in a new class a new HbDataStore,
load my meta-model from ecore files with my injectors,
then register the package of my meta-model with setEPackage(mypackages),
I can add my models to the HbDataStore with no problems, it works fine.
But when I retrieve a previously loaded meta-model from Teneo, and then
register his packages to the HbDataStore, I can't persist any model...
I obtain this exception :
found
org.eclipse.gmt.am3.core.storage.RepositoryException:
java.lang.IllegalArgumentException: No annotated model element present
for: Deb for type EClass has its epackage been registered with Teneo?
at test.teneoRep.addModel(teneoRep.java:803)
at test.testrepository.main(testrepository.java:103)
Caused by: java.lang.IllegalArgumentException: No annotated model
element present for: Deb for type EClass has its epackage been
registered with Teneo?
at
org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
at
org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
at
org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
at
org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
at org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
at
org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at
org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
at test.teneoRep.addMo(teneoRep.java:296)
at test.teneoRep.addM(teneoRep.java:327)
at test.teneoRep.addModel(teneoRep.java:801)
at test.testrepository.main(testrepository.java:103)
I have tried many ways, but I obtain always the same exception.
Can you help me ?
Thanks,
guillaume doux
|
|
|
Re: [TENEO] No annotated model element present [message #90808 is a reply to message #90777] |
Thu, 19 July 2007 12:45 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi,
What do you mean with this step:
But when I retrieve a previously loaded meta-model from Teneo, and then
register his packages to the HbDataStore, I can't persist any model...
What I understand is that you retrieve the epackage from Teneo (so load it from the db) and register
this epackage with another datastore?
gr. Martin
doux guillaume wrote:
> Hi,
>
> I'm always experiencing problems to add models corresponding to my
> meta-model in Teneo.
>
> If I create in a new class a new HbDataStore,
> load my meta-model from ecore files with my injectors,
> then register the package of my meta-model with setEPackage(mypackages),
> I can add my models to the HbDataStore with no problems, it works fine.
>
> But when I retrieve a previously loaded meta-model from Teneo, and then
> register his packages to the HbDataStore, I can't persist any model...
>
> I obtain this exception :
>
> found
> org.eclipse.gmt.am3.core.storage.RepositoryException:
> java.lang.IllegalArgumentException: No annotated model element present
> for: Deb for type EClass has its epackage been registered with Teneo?
> at test.teneoRep.addModel(teneoRep.java:803)
> at test.testrepository.main(testrepository.java:103)
> Caused by: java.lang.IllegalArgumentException: No annotated model
> element present for: Deb for type EClass has its epackage been
> registered with Teneo?
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>
> at
> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>
> at
> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>
> at
> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
> at
> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
> at
> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>
> at
> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>
> at
> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>
> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
> at test.teneoRep.addMo(teneoRep.java:296)
> at test.teneoRep.addM(teneoRep.java:327)
> at test.teneoRep.addModel(teneoRep.java:801)
> at test.testrepository.main(testrepository.java:103)
>
> I have tried many ways, but I obtain always the same exception.
>
> Can you help me ?
>
>
> Thanks,
>
> guillaume doux
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [TENEO] No annotated model element present [message #90859 is a reply to message #90808] |
Thu, 19 July 2007 13:20 |
Eclipse User |
|
|
|
Originally posted by: doux.guil.gmail.com
Hi,
In fact, I have to implement a model and meta-model repository with
teneo. My model and meta-models are represented by a structure which
contains a resource, with package inside for the meta-models and objects
corresponding to a meta-model for the model.
I store meta-data on separate table on the database to know that a model
go with a metamodel.
So, when I have to store a model in the repository, I retrieve the
corresponding meta-model from the repository and then I get his epackage
to register it from an HbDataStore and then save my model in this
datastore. I have try to do this with only one datastore by
reinitializing it, and also with a new datastore but I obtain always the
same exception.
I have seen by looking at the generated mapping some difference between
the mapping generated after loading a meta-model from file or from teneo
but it's not seem to be that.
The most curious thing is that when I export a meta-model from Teneo to
an ecore file, and then load it to register his packages and then
persist my model with Teneo, it works fine.
So I don't understand why it doesn't work.
Thanks for the help,
guillaume
Martin Taal wrote:
> Hi,
> What do you mean with this step:
> But when I retrieve a previously loaded meta-model from Teneo, and then
> register his packages to the HbDataStore, I can't persist any model...
>
> What I understand is that you retrieve the epackage from Teneo (so load
> it from the db) and register this epackage with another datastore?
>
> gr. Martin
>
> doux guillaume wrote:
>> Hi,
>>
>> I'm always experiencing problems to add models corresponding to my
>> meta-model in Teneo.
>>
>> If I create in a new class a new HbDataStore,
>> load my meta-model from ecore files with my injectors,
>> then register the package of my meta-model with setEPackage(mypackages),
>> I can add my models to the HbDataStore with no problems, it works fine.
>>
>> But when I retrieve a previously loaded meta-model from Teneo, and then
>> register his packages to the HbDataStore, I can't persist any model...
>>
>> I obtain this exception :
>>
>> found
>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>> java.lang.IllegalArgumentException: No annotated model element present
>> for: Deb for type EClass has its epackage been registered with Teneo?
>> at test.teneoRep.addModel(teneoRep.java:803)
>> at test.testrepository.main(testrepository.java:103)
>> Caused by: java.lang.IllegalArgumentException: No annotated model
>> element present for: Deb for type EClass has its epackage been
>> registered with Teneo?
>> at
>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>
>> at
>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>
>> at
>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>
>> at
>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>
>> at
>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>> at
>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>
>> at
>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>
>> at
>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>
>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>> at test.teneoRep.addMo(teneoRep.java:296)
>> at test.teneoRep.addM(teneoRep.java:327)
>> at test.teneoRep.addModel(teneoRep.java:801)
>> at test.testrepository.main(testrepository.java:103)
>>
>> I have tried many ways, but I obtain always the same exception.
>>
>> Can you help me ?
>>
>>
>> Thanks,
>>
>> guillaume doux
>
>
|
|
|
Re: [TENEO] No annotated model element present [message #90906 is a reply to message #90859] |
Thu, 19 July 2007 13:56 |
Eclipse User |
|
|
|
Originally posted by: doux.guil.gmail.com
Hi,
I think I have solved my problem, I haven't correctly initialize my new
hbdatastore.
It seems to be working.
thanks
guillaume
doux guillaume wrote:
> Hi,
>
> In fact, I have to implement a model and meta-model repository with
> teneo. My model and meta-models are represented by a structure which
> contains a resource, with package inside for the meta-models and objects
> corresponding to a meta-model for the model.
> I store meta-data on separate table on the database to know that a model
> go with a metamodel.
>
> So, when I have to store a model in the repository, I retrieve the
> corresponding meta-model from the repository and then I get his epackage
> to register it from an HbDataStore and then save my model in this
> datastore. I have try to do this with only one datastore by
> reinitializing it, and also with a new datastore but I obtain always the
> same exception.
>
> I have seen by looking at the generated mapping some difference between
> the mapping generated after loading a meta-model from file or from teneo
> but it's not seem to be that.
>
> The most curious thing is that when I export a meta-model from Teneo to
> an ecore file, and then load it to register his packages and then
> persist my model with Teneo, it works fine.
>
> So I don't understand why it doesn't work.
>
> Thanks for the help,
>
> guillaume
>
>
> Martin Taal wrote:
>> Hi,
>> What do you mean with this step:
>> But when I retrieve a previously loaded meta-model from Teneo, and then
>> register his packages to the HbDataStore, I can't persist any model...
>>
>> What I understand is that you retrieve the epackage from Teneo (so
>> load it from the db) and register this epackage with another datastore?
>>
>> gr. Martin
>>
>> doux guillaume wrote:
>>> Hi,
>>>
>>> I'm always experiencing problems to add models corresponding to my
>>> meta-model in Teneo.
>>>
>>> If I create in a new class a new HbDataStore,
>>> load my meta-model from ecore files with my injectors,
>>> then register the package of my meta-model with setEPackage(mypackages),
>>> I can add my models to the HbDataStore with no problems, it works fine.
>>>
>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>> register his packages to the HbDataStore, I can't persist any model...
>>>
>>> I obtain this exception :
>>>
>>> found
>>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>>> java.lang.IllegalArgumentException: No annotated model element
>>> present for: Deb for type EClass has its epackage been registered
>>> with Teneo?
>>> at test.teneoRep.addModel(teneoRep.java:803)
>>> at test.testrepository.main(testrepository.java:103)
>>> Caused by: java.lang.IllegalArgumentException: No annotated model
>>> element present for: Deb for type EClass has its epackage been
>>> registered with Teneo?
>>> at
>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>>
>>> at
>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>>
>>> at
>>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>>
>>> at
>>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>>> at
>>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>
>>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>>> at test.teneoRep.addMo(teneoRep.java:296)
>>> at test.teneoRep.addM(teneoRep.java:327)
>>> at test.teneoRep.addModel(teneoRep.java:801)
>>> at test.testrepository.main(testrepository.java:103)
>>>
>>> I have tried many ways, but I obtain always the same exception.
>>>
>>> Can you help me ?
>>>
>>>
>>> Thanks,
>>>
>>> guillaume doux
>>
>>
|
|
|
Re: [TENEO] No annotated model element present [message #90920 is a reply to message #90906] |
Thu, 19 July 2007 14:18 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Guillaume,
That's good, thanks for the update. One thing you should also do is register the epackage, you read
from the db, in the global epackage.registry.
gr. Martin
doux guillaume wrote:
> Hi,
>
> I think I have solved my problem, I haven't correctly initialize my new
> hbdatastore.
>
> It seems to be working.
>
> thanks
>
> guillaume
>
> doux guillaume wrote:
>> Hi,
>>
>> In fact, I have to implement a model and meta-model repository with
>> teneo. My model and meta-models are represented by a structure which
>> contains a resource, with package inside for the meta-models and
>> objects corresponding to a meta-model for the model.
>> I store meta-data on separate table on the database to know that a model
>> go with a metamodel.
>>
>> So, when I have to store a model in the repository, I retrieve the
>> corresponding meta-model from the repository and then I get his
>> epackage to register it from an HbDataStore and then save my model in
>> this datastore. I have try to do this with only one datastore by
>> reinitializing it, and also with a new datastore but I obtain always
>> the same exception.
>>
>> I have seen by looking at the generated mapping some difference
>> between the mapping generated after loading a meta-model from file or
>> from teneo
>> but it's not seem to be that.
>>
>> The most curious thing is that when I export a meta-model from Teneo
>> to an ecore file, and then load it to register his packages and then
>> persist my model with Teneo, it works fine.
>>
>> So I don't understand why it doesn't work.
>>
>> Thanks for the help,
>>
>> guillaume
>>
>>
>> Martin Taal wrote:
>>> Hi,
>>> What do you mean with this step:
>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>> register his packages to the HbDataStore, I can't persist any model...
>>>
>>> What I understand is that you retrieve the epackage from Teneo (so
>>> load it from the db) and register this epackage with another datastore?
>>>
>>> gr. Martin
>>>
>>> doux guillaume wrote:
>>>> Hi,
>>>>
>>>> I'm always experiencing problems to add models corresponding to my
>>>> meta-model in Teneo.
>>>>
>>>> If I create in a new class a new HbDataStore,
>>>> load my meta-model from ecore files with my injectors,
>>>> then register the package of my meta-model with
>>>> setEPackage(mypackages),
>>>> I can add my models to the HbDataStore with no problems, it works fine.
>>>>
>>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>>> register his packages to the HbDataStore, I can't persist any model...
>>>>
>>>> I obtain this exception :
>>>>
>>>> found
>>>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>>>> java.lang.IllegalArgumentException: No annotated model element
>>>> present for: Deb for type EClass has its epackage been registered
>>>> with Teneo?
>>>> at test.teneoRep.addModel(teneoRep.java:803)
>>>> at test.testrepository.main(testrepository.java:103)
>>>> Caused by: java.lang.IllegalArgumentException: No annotated model
>>>> element present for: Deb for type EClass has its epackage been
>>>> registered with Teneo?
>>>> at
>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>>>
>>>> at
>>>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>>>> at
>>>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>>>>
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>>
>>>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>>>> at test.teneoRep.addMo(teneoRep.java:296)
>>>> at test.teneoRep.addM(teneoRep.java:327)
>>>> at test.teneoRep.addModel(teneoRep.java:801)
>>>> at test.testrepository.main(testrepository.java:103)
>>>>
>>>> I have tried many ways, but I obtain always the same exception.
>>>>
>>>> Can you help me ?
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> guillaume doux
>>>
>>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [TENEO] No annotated model element present [message #90935 is a reply to message #90906] |
Thu, 19 July 2007 14:23 |
Eclipse User |
|
|
|
Originally posted by: doux.guil.gmail.com
Hi again,
In fact it's only seems to work, I have always my ecxeption ...
guillaume
doux guillaume wrote:
> Hi,
>
> I think I have solved my problem, I haven't correctly initialize my new
> hbdatastore.
>
> It seems to be working.
>
> thanks
>
> guillaume
>
> doux guillaume wrote:
>> Hi,
>>
>> In fact, I have to implement a model and meta-model repository with
>> teneo. My model and meta-models are represented by a structure which
>> contains a resource, with package inside for the meta-models and
>> objects corresponding to a meta-model for the model.
>> I store meta-data on separate table on the database to know that a model
>> go with a metamodel.
>>
>> So, when I have to store a model in the repository, I retrieve the
>> corresponding meta-model from the repository and then I get his
>> epackage to register it from an HbDataStore and then save my model in
>> this datastore. I have try to do this with only one datastore by
>> reinitializing it, and also with a new datastore but I obtain always
>> the same exception.
>>
>> I have seen by looking at the generated mapping some difference
>> between the mapping generated after loading a meta-model from file or
>> from teneo
>> but it's not seem to be that.
>>
>> The most curious thing is that when I export a meta-model from Teneo
>> to an ecore file, and then load it to register his packages and then
>> persist my model with Teneo, it works fine.
>>
>> So I don't understand why it doesn't work.
>>
>> Thanks for the help,
>>
>> guillaume
>>
>>
>> Martin Taal wrote:
>>> Hi,
>>> What do you mean with this step:
>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>> register his packages to the HbDataStore, I can't persist any model...
>>>
>>> What I understand is that you retrieve the epackage from Teneo (so
>>> load it from the db) and register this epackage with another datastore?
>>>
>>> gr. Martin
>>>
>>> doux guillaume wrote:
>>>> Hi,
>>>>
>>>> I'm always experiencing problems to add models corresponding to my
>>>> meta-model in Teneo.
>>>>
>>>> If I create in a new class a new HbDataStore,
>>>> load my meta-model from ecore files with my injectors,
>>>> then register the package of my meta-model with
>>>> setEPackage(mypackages),
>>>> I can add my models to the HbDataStore with no problems, it works fine.
>>>>
>>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>>> register his packages to the HbDataStore, I can't persist any model...
>>>>
>>>> I obtain this exception :
>>>>
>>>> found
>>>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>>>> java.lang.IllegalArgumentException: No annotated model element
>>>> present for: Deb for type EClass has its epackage been registered
>>>> with Teneo?
>>>> at test.teneoRep.addModel(teneoRep.java:803)
>>>> at test.testrepository.main(testrepository.java:103)
>>>> Caused by: java.lang.IllegalArgumentException: No annotated model
>>>> element present for: Deb for type EClass has its epackage been
>>>> registered with Teneo?
>>>> at
>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>>>
>>>> at
>>>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>>>> at
>>>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>>>>
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>>
>>>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>>>> at test.teneoRep.addMo(teneoRep.java:296)
>>>> at test.teneoRep.addM(teneoRep.java:327)
>>>> at test.teneoRep.addModel(teneoRep.java:801)
>>>> at test.testrepository.main(testrepository.java:103)
>>>>
>>>> I have tried many ways, but I obtain always the same exception.
>>>>
>>>> Can you help me ?
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> guillaume doux
>>>
>>>
|
|
|
Re: [TENEO] No annotated model element present [message #90949 is a reply to message #90920] |
Thu, 19 July 2007 15:39 |
Eclipse User |
|
|
|
Originally posted by: doux.guil.gmail.com
Hi,
I have tried to register my packages, who come from the deb in the
epackage.registry.eINSTANCE but it doesn't work more...
have you another idea ?
thanks,
guillaume
Martin Taal wrote:
> Hi Guillaume,
> That's good, thanks for the update. One thing you should also do is
> register the epackage, you read from the db, in the global
> epackage.registry.
>
> gr. Martin
>
> doux guillaume wrote:
>> Hi,
>>
>> I think I have solved my problem, I haven't correctly initialize my
>> new hbdatastore.
>>
>> It seems to be working.
>>
>> thanks
>>
>> guillaume
>>
>> doux guillaume wrote:
>>> Hi,
>>>
>>> In fact, I have to implement a model and meta-model repository with
>>> teneo. My model and meta-models are represented by a structure which
>>> contains a resource, with package inside for the meta-models and
>>> objects corresponding to a meta-model for the model.
>>> I store meta-data on separate table on the database to know that a model
>>> go with a metamodel.
>>>
>>> So, when I have to store a model in the repository, I retrieve the
>>> corresponding meta-model from the repository and then I get his
>>> epackage to register it from an HbDataStore and then save my model in
>>> this datastore. I have try to do this with only one datastore by
>>> reinitializing it, and also with a new datastore but I obtain always
>>> the same exception.
>>>
>>> I have seen by looking at the generated mapping some difference
>>> between the mapping generated after loading a meta-model from file or
>>> from teneo
>>> but it's not seem to be that.
>>>
>>> The most curious thing is that when I export a meta-model from Teneo
>>> to an ecore file, and then load it to register his packages and then
>>> persist my model with Teneo, it works fine.
>>>
>>> So I don't understand why it doesn't work.
>>>
>>> Thanks for the help,
>>>
>>> guillaume
>>>
>>>
>>> Martin Taal wrote:
>>>> Hi,
>>>> What do you mean with this step:
>>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>>> register his packages to the HbDataStore, I can't persist any model...
>>>>
>>>> What I understand is that you retrieve the epackage from Teneo (so
>>>> load it from the db) and register this epackage with another datastore?
>>>>
>>>> gr. Martin
>>>>
>>>> doux guillaume wrote:
>>>>> Hi,
>>>>>
>>>>> I'm always experiencing problems to add models corresponding to my
>>>>> meta-model in Teneo.
>>>>>
>>>>> If I create in a new class a new HbDataStore,
>>>>> load my meta-model from ecore files with my injectors,
>>>>> then register the package of my meta-model with
>>>>> setEPackage(mypackages),
>>>>> I can add my models to the HbDataStore with no problems, it works
>>>>> fine.
>>>>>
>>>>> But when I retrieve a previously loaded meta-model from Teneo, and
>>>>> then
>>>>> register his packages to the HbDataStore, I can't persist any model...
>>>>>
>>>>> I obtain this exception :
>>>>>
>>>>> found
>>>>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>>>>> java.lang.IllegalArgumentException: No annotated model element
>>>>> present for: Deb for type EClass has its epackage been registered
>>>>> with Teneo?
>>>>> at test.teneoRep.addModel(teneoRep.java:803)
>>>>> at test.testrepository.main(testrepository.java:103)
>>>>> Caused by: java.lang.IllegalArgumentException: No annotated model
>>>>> element present for: Deb for type EClass has its epackage been
>>>>> registered with Teneo?
>>>>> at
>>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>>>>
>>>>> at
>>>>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>>>>> at
>>>>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>>>
>>>>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>>>>> at test.teneoRep.addMo(teneoRep.java:296)
>>>>> at test.teneoRep.addM(teneoRep.java:327)
>>>>> at test.teneoRep.addModel(teneoRep.java:801)
>>>>> at test.testrepository.main(testrepository.java:103)
>>>>>
>>>>> I have tried many ways, but I obtain always the same exception.
>>>>>
>>>>> Can you help me ?
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> guillaume doux
>>>>
>>>>
>
>
|
|
|
Re: [TENEO] No annotated model element present [message #90964 is a reply to message #90949] |
Thu, 19 July 2007 15:54 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Guillaume,
Not much more than debug through the code. You can set a break point in the map method of the
AnnotationGenerator. This method receives an annotatedModel. The annotatedModel is a representation
of your epackages with additional jpa annotations.
The exception is thrown because the eclass Deb is not present in the annotatedmodel.
You can check if your epackages are actually present in the annotatedModel (look for the
AnnotatedElement member). Also check if they are the same instances, maybe your epackages are
present in memory multiple times.
If you can package it all in a eclipse project with a testcase then I can also try to reproduce it.
gr. Martin
doux guillaume wrote:
> Hi,
>
> I have tried to register my packages, who come from the deb in the
> epackage.registry.eINSTANCE but it doesn't work more...
>
> have you another idea ?
>
> thanks,
>
> guillaume
>
> Martin Taal wrote:
>> Hi Guillaume,
>> That's good, thanks for the update. One thing you should also do is
>> register the epackage, you read from the db, in the global
>> epackage.registry.
>>
>> gr. Martin
>>
>> doux guillaume wrote:
>>> Hi,
>>>
>>> I think I have solved my problem, I haven't correctly initialize my
>>> new hbdatastore.
>>>
>>> It seems to be working.
>>>
>>> thanks
>>>
>>> guillaume
>>>
>>> doux guillaume wrote:
>>>> Hi,
>>>>
>>>> In fact, I have to implement a model and meta-model repository with
>>>> teneo. My model and meta-models are represented by a structure which
>>>> contains a resource, with package inside for the meta-models and
>>>> objects corresponding to a meta-model for the model.
>>>> I store meta-data on separate table on the database to know that a
>>>> model
>>>> go with a metamodel.
>>>>
>>>> So, when I have to store a model in the repository, I retrieve the
>>>> corresponding meta-model from the repository and then I get his
>>>> epackage to register it from an HbDataStore and then save my model
>>>> in this datastore. I have try to do this with only one datastore by
>>>> reinitializing it, and also with a new datastore but I obtain always
>>>> the same exception.
>>>>
>>>> I have seen by looking at the generated mapping some difference
>>>> between the mapping generated after loading a meta-model from file
>>>> or from teneo
>>>> but it's not seem to be that.
>>>>
>>>> The most curious thing is that when I export a meta-model from Teneo
>>>> to an ecore file, and then load it to register his packages and then
>>>> persist my model with Teneo, it works fine.
>>>>
>>>> So I don't understand why it doesn't work.
>>>>
>>>> Thanks for the help,
>>>>
>>>> guillaume
>>>>
>>>>
>>>> Martin Taal wrote:
>>>>> Hi,
>>>>> What do you mean with this step:
>>>>> But when I retrieve a previously loaded meta-model from Teneo, and
>>>>> then
>>>>> register his packages to the HbDataStore, I can't persist any model...
>>>>>
>>>>> What I understand is that you retrieve the epackage from Teneo (so
>>>>> load it from the db) and register this epackage with another
>>>>> datastore?
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> doux guillaume wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I'm always experiencing problems to add models corresponding to my
>>>>>> meta-model in Teneo.
>>>>>>
>>>>>> If I create in a new class a new HbDataStore,
>>>>>> load my meta-model from ecore files with my injectors,
>>>>>> then register the package of my meta-model with
>>>>>> setEPackage(mypackages),
>>>>>> I can add my models to the HbDataStore with no problems, it works
>>>>>> fine.
>>>>>>
>>>>>> But when I retrieve a previously loaded meta-model from Teneo, and
>>>>>> then
>>>>>> register his packages to the HbDataStore, I can't persist any
>>>>>> model...
>>>>>>
>>>>>> I obtain this exception :
>>>>>>
>>>>>> found
>>>>>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>>>>>> java.lang.IllegalArgumentException: No annotated model element
>>>>>> present for: Deb for type EClass has its epackage been registered
>>>>>> with Teneo?
>>>>>> at test.teneoRep.addModel(teneoRep.java:803)
>>>>>> at test.testrepository.main(testrepository.java:103)
>>>>>> Caused by: java.lang.IllegalArgumentException: No annotated model
>>>>>> element present for: Deb for type EClass has its epackage been
>>>>>> registered with Teneo?
>>>>>> at
>>>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>>>>>> at
>>>>>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>>>>
>>>>>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>>>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>>>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>>>>>> at test.teneoRep.addMo(teneoRep.java:296)
>>>>>> at test.teneoRep.addM(teneoRep.java:327)
>>>>>> at test.teneoRep.addModel(teneoRep.java:801)
>>>>>> at test.testrepository.main(testrepository.java:103)
>>>>>>
>>>>>> I have tried many ways, but I obtain always the same exception.
>>>>>>
>>>>>> Can you help me ?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> guillaume doux
>>>>>
>>>>>
>>
>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [TENEO] No annotated model element present [message #608814 is a reply to message #90777] |
Thu, 19 July 2007 12:45 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi,
What do you mean with this step:
But when I retrieve a previously loaded meta-model from Teneo, and then
register his packages to the HbDataStore, I can't persist any model...
What I understand is that you retrieve the epackage from Teneo (so load it from the db) and register
this epackage with another datastore?
gr. Martin
doux guillaume wrote:
> Hi,
>
> I'm always experiencing problems to add models corresponding to my
> meta-model in Teneo.
>
> If I create in a new class a new HbDataStore,
> load my meta-model from ecore files with my injectors,
> then register the package of my meta-model with setEPackage(mypackages),
> I can add my models to the HbDataStore with no problems, it works fine.
>
> But when I retrieve a previously loaded meta-model from Teneo, and then
> register his packages to the HbDataStore, I can't persist any model...
>
> I obtain this exception :
>
> found
> org.eclipse.gmt.am3.core.storage.RepositoryException:
> java.lang.IllegalArgumentException: No annotated model element present
> for: Deb for type EClass has its epackage been registered with Teneo?
> at test.teneoRep.addModel(teneoRep.java:803)
> at test.testrepository.main(testrepository.java:103)
> Caused by: java.lang.IllegalArgumentException: No annotated model
> element present for: Deb for type EClass has its epackage been
> registered with Teneo?
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>
> at
> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>
> at
> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>
> at
> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
> at
> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
> at
> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>
> at
> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>
> at
> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>
> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
> at test.teneoRep.addMo(teneoRep.java:296)
> at test.teneoRep.addM(teneoRep.java:327)
> at test.teneoRep.addModel(teneoRep.java:801)
> at test.testrepository.main(testrepository.java:103)
>
> I have tried many ways, but I obtain always the same exception.
>
> Can you help me ?
>
>
> Thanks,
>
> guillaume doux
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [TENEO] No annotated model element present [message #608817 is a reply to message #90808] |
Thu, 19 July 2007 13:20 |
Eclipse User |
|
|
|
Originally posted by: doux.guil.gmail.com
Hi,
In fact, I have to implement a model and meta-model repository with
teneo. My model and meta-models are represented by a structure which
contains a resource, with package inside for the meta-models and objects
corresponding to a meta-model for the model.
I store meta-data on separate table on the database to know that a model
go with a metamodel.
So, when I have to store a model in the repository, I retrieve the
corresponding meta-model from the repository and then I get his epackage
to register it from an HbDataStore and then save my model in this
datastore. I have try to do this with only one datastore by
reinitializing it, and also with a new datastore but I obtain always the
same exception.
I have seen by looking at the generated mapping some difference between
the mapping generated after loading a meta-model from file or from teneo
but it's not seem to be that.
The most curious thing is that when I export a meta-model from Teneo to
an ecore file, and then load it to register his packages and then
persist my model with Teneo, it works fine.
So I don't understand why it doesn't work.
Thanks for the help,
guillaume
Martin Taal wrote:
> Hi,
> What do you mean with this step:
> But when I retrieve a previously loaded meta-model from Teneo, and then
> register his packages to the HbDataStore, I can't persist any model...
>
> What I understand is that you retrieve the epackage from Teneo (so load
> it from the db) and register this epackage with another datastore?
>
> gr. Martin
>
> doux guillaume wrote:
>> Hi,
>>
>> I'm always experiencing problems to add models corresponding to my
>> meta-model in Teneo.
>>
>> If I create in a new class a new HbDataStore,
>> load my meta-model from ecore files with my injectors,
>> then register the package of my meta-model with setEPackage(mypackages),
>> I can add my models to the HbDataStore with no problems, it works fine.
>>
>> But when I retrieve a previously loaded meta-model from Teneo, and then
>> register his packages to the HbDataStore, I can't persist any model...
>>
>> I obtain this exception :
>>
>> found
>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>> java.lang.IllegalArgumentException: No annotated model element present
>> for: Deb for type EClass has its epackage been registered with Teneo?
>> at test.teneoRep.addModel(teneoRep.java:803)
>> at test.testrepository.main(testrepository.java:103)
>> Caused by: java.lang.IllegalArgumentException: No annotated model
>> element present for: Deb for type EClass has its epackage been
>> registered with Teneo?
>> at
>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>
>> at
>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>
>> at
>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>
>> at
>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>
>> at
>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>> at
>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>
>> at
>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>
>> at
>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>
>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>> at test.teneoRep.addMo(teneoRep.java:296)
>> at test.teneoRep.addM(teneoRep.java:327)
>> at test.teneoRep.addModel(teneoRep.java:801)
>> at test.testrepository.main(testrepository.java:103)
>>
>> I have tried many ways, but I obtain always the same exception.
>>
>> Can you help me ?
>>
>>
>> Thanks,
>>
>> guillaume doux
>
>
|
|
|
Re: [TENEO] No annotated model element present [message #608820 is a reply to message #90859] |
Thu, 19 July 2007 13:56 |
Eclipse User |
|
|
|
Originally posted by: doux.guil.gmail.com
Hi,
I think I have solved my problem, I haven't correctly initialize my new
hbdatastore.
It seems to be working.
thanks
guillaume
doux guillaume wrote:
> Hi,
>
> In fact, I have to implement a model and meta-model repository with
> teneo. My model and meta-models are represented by a structure which
> contains a resource, with package inside for the meta-models and objects
> corresponding to a meta-model for the model.
> I store meta-data on separate table on the database to know that a model
> go with a metamodel.
>
> So, when I have to store a model in the repository, I retrieve the
> corresponding meta-model from the repository and then I get his epackage
> to register it from an HbDataStore and then save my model in this
> datastore. I have try to do this with only one datastore by
> reinitializing it, and also with a new datastore but I obtain always the
> same exception.
>
> I have seen by looking at the generated mapping some difference between
> the mapping generated after loading a meta-model from file or from teneo
> but it's not seem to be that.
>
> The most curious thing is that when I export a meta-model from Teneo to
> an ecore file, and then load it to register his packages and then
> persist my model with Teneo, it works fine.
>
> So I don't understand why it doesn't work.
>
> Thanks for the help,
>
> guillaume
>
>
> Martin Taal wrote:
>> Hi,
>> What do you mean with this step:
>> But when I retrieve a previously loaded meta-model from Teneo, and then
>> register his packages to the HbDataStore, I can't persist any model...
>>
>> What I understand is that you retrieve the epackage from Teneo (so
>> load it from the db) and register this epackage with another datastore?
>>
>> gr. Martin
>>
>> doux guillaume wrote:
>>> Hi,
>>>
>>> I'm always experiencing problems to add models corresponding to my
>>> meta-model in Teneo.
>>>
>>> If I create in a new class a new HbDataStore,
>>> load my meta-model from ecore files with my injectors,
>>> then register the package of my meta-model with setEPackage(mypackages),
>>> I can add my models to the HbDataStore with no problems, it works fine.
>>>
>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>> register his packages to the HbDataStore, I can't persist any model...
>>>
>>> I obtain this exception :
>>>
>>> found
>>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>>> java.lang.IllegalArgumentException: No annotated model element
>>> present for: Deb for type EClass has its epackage been registered
>>> with Teneo?
>>> at test.teneoRep.addModel(teneoRep.java:803)
>>> at test.testrepository.main(testrepository.java:103)
>>> Caused by: java.lang.IllegalArgumentException: No annotated model
>>> element present for: Deb for type EClass has its epackage been
>>> registered with Teneo?
>>> at
>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>>
>>> at
>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>>
>>> at
>>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>>
>>> at
>>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>>> at
>>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>
>>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>>> at test.teneoRep.addMo(teneoRep.java:296)
>>> at test.teneoRep.addM(teneoRep.java:327)
>>> at test.teneoRep.addModel(teneoRep.java:801)
>>> at test.testrepository.main(testrepository.java:103)
>>>
>>> I have tried many ways, but I obtain always the same exception.
>>>
>>> Can you help me ?
>>>
>>>
>>> Thanks,
>>>
>>> guillaume doux
>>
>>
|
|
|
Re: [TENEO] No annotated model element present [message #608821 is a reply to message #90906] |
Thu, 19 July 2007 14:18 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Guillaume,
That's good, thanks for the update. One thing you should also do is register the epackage, you read
from the db, in the global epackage.registry.
gr. Martin
doux guillaume wrote:
> Hi,
>
> I think I have solved my problem, I haven't correctly initialize my new
> hbdatastore.
>
> It seems to be working.
>
> thanks
>
> guillaume
>
> doux guillaume wrote:
>> Hi,
>>
>> In fact, I have to implement a model and meta-model repository with
>> teneo. My model and meta-models are represented by a structure which
>> contains a resource, with package inside for the meta-models and
>> objects corresponding to a meta-model for the model.
>> I store meta-data on separate table on the database to know that a model
>> go with a metamodel.
>>
>> So, when I have to store a model in the repository, I retrieve the
>> corresponding meta-model from the repository and then I get his
>> epackage to register it from an HbDataStore and then save my model in
>> this datastore. I have try to do this with only one datastore by
>> reinitializing it, and also with a new datastore but I obtain always
>> the same exception.
>>
>> I have seen by looking at the generated mapping some difference
>> between the mapping generated after loading a meta-model from file or
>> from teneo
>> but it's not seem to be that.
>>
>> The most curious thing is that when I export a meta-model from Teneo
>> to an ecore file, and then load it to register his packages and then
>> persist my model with Teneo, it works fine.
>>
>> So I don't understand why it doesn't work.
>>
>> Thanks for the help,
>>
>> guillaume
>>
>>
>> Martin Taal wrote:
>>> Hi,
>>> What do you mean with this step:
>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>> register his packages to the HbDataStore, I can't persist any model...
>>>
>>> What I understand is that you retrieve the epackage from Teneo (so
>>> load it from the db) and register this epackage with another datastore?
>>>
>>> gr. Martin
>>>
>>> doux guillaume wrote:
>>>> Hi,
>>>>
>>>> I'm always experiencing problems to add models corresponding to my
>>>> meta-model in Teneo.
>>>>
>>>> If I create in a new class a new HbDataStore,
>>>> load my meta-model from ecore files with my injectors,
>>>> then register the package of my meta-model with
>>>> setEPackage(mypackages),
>>>> I can add my models to the HbDataStore with no problems, it works fine.
>>>>
>>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>>> register his packages to the HbDataStore, I can't persist any model...
>>>>
>>>> I obtain this exception :
>>>>
>>>> found
>>>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>>>> java.lang.IllegalArgumentException: No annotated model element
>>>> present for: Deb for type EClass has its epackage been registered
>>>> with Teneo?
>>>> at test.teneoRep.addModel(teneoRep.java:803)
>>>> at test.testrepository.main(testrepository.java:103)
>>>> Caused by: java.lang.IllegalArgumentException: No annotated model
>>>> element present for: Deb for type EClass has its epackage been
>>>> registered with Teneo?
>>>> at
>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>>>
>>>> at
>>>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>>>> at
>>>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>>>>
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>>
>>>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>>>> at test.teneoRep.addMo(teneoRep.java:296)
>>>> at test.teneoRep.addM(teneoRep.java:327)
>>>> at test.teneoRep.addModel(teneoRep.java:801)
>>>> at test.testrepository.main(testrepository.java:103)
>>>>
>>>> I have tried many ways, but I obtain always the same exception.
>>>>
>>>> Can you help me ?
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> guillaume doux
>>>
>>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [TENEO] No annotated model element present [message #608822 is a reply to message #90906] |
Thu, 19 July 2007 14:23 |
Eclipse User |
|
|
|
Originally posted by: doux.guil.gmail.com
Hi again,
In fact it's only seems to work, I have always my ecxeption ...
guillaume
doux guillaume wrote:
> Hi,
>
> I think I have solved my problem, I haven't correctly initialize my new
> hbdatastore.
>
> It seems to be working.
>
> thanks
>
> guillaume
>
> doux guillaume wrote:
>> Hi,
>>
>> In fact, I have to implement a model and meta-model repository with
>> teneo. My model and meta-models are represented by a structure which
>> contains a resource, with package inside for the meta-models and
>> objects corresponding to a meta-model for the model.
>> I store meta-data on separate table on the database to know that a model
>> go with a metamodel.
>>
>> So, when I have to store a model in the repository, I retrieve the
>> corresponding meta-model from the repository and then I get his
>> epackage to register it from an HbDataStore and then save my model in
>> this datastore. I have try to do this with only one datastore by
>> reinitializing it, and also with a new datastore but I obtain always
>> the same exception.
>>
>> I have seen by looking at the generated mapping some difference
>> between the mapping generated after loading a meta-model from file or
>> from teneo
>> but it's not seem to be that.
>>
>> The most curious thing is that when I export a meta-model from Teneo
>> to an ecore file, and then load it to register his packages and then
>> persist my model with Teneo, it works fine.
>>
>> So I don't understand why it doesn't work.
>>
>> Thanks for the help,
>>
>> guillaume
>>
>>
>> Martin Taal wrote:
>>> Hi,
>>> What do you mean with this step:
>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>> register his packages to the HbDataStore, I can't persist any model...
>>>
>>> What I understand is that you retrieve the epackage from Teneo (so
>>> load it from the db) and register this epackage with another datastore?
>>>
>>> gr. Martin
>>>
>>> doux guillaume wrote:
>>>> Hi,
>>>>
>>>> I'm always experiencing problems to add models corresponding to my
>>>> meta-model in Teneo.
>>>>
>>>> If I create in a new class a new HbDataStore,
>>>> load my meta-model from ecore files with my injectors,
>>>> then register the package of my meta-model with
>>>> setEPackage(mypackages),
>>>> I can add my models to the HbDataStore with no problems, it works fine.
>>>>
>>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>>> register his packages to the HbDataStore, I can't persist any model...
>>>>
>>>> I obtain this exception :
>>>>
>>>> found
>>>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>>>> java.lang.IllegalArgumentException: No annotated model element
>>>> present for: Deb for type EClass has its epackage been registered
>>>> with Teneo?
>>>> at test.teneoRep.addModel(teneoRep.java:803)
>>>> at test.testrepository.main(testrepository.java:103)
>>>> Caused by: java.lang.IllegalArgumentException: No annotated model
>>>> element present for: Deb for type EClass has its epackage been
>>>> registered with Teneo?
>>>> at
>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>>>
>>>> at
>>>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>>>> at
>>>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>>>>
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>>
>>>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>>>> at test.teneoRep.addMo(teneoRep.java:296)
>>>> at test.teneoRep.addM(teneoRep.java:327)
>>>> at test.teneoRep.addModel(teneoRep.java:801)
>>>> at test.testrepository.main(testrepository.java:103)
>>>>
>>>> I have tried many ways, but I obtain always the same exception.
>>>>
>>>> Can you help me ?
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> guillaume doux
>>>
>>>
|
|
|
Re: [TENEO] No annotated model element present [message #608823 is a reply to message #90920] |
Thu, 19 July 2007 15:39 |
Eclipse User |
|
|
|
Originally posted by: doux.guil.gmail.com
Hi,
I have tried to register my packages, who come from the deb in the
epackage.registry.eINSTANCE but it doesn't work more...
have you another idea ?
thanks,
guillaume
Martin Taal wrote:
> Hi Guillaume,
> That's good, thanks for the update. One thing you should also do is
> register the epackage, you read from the db, in the global
> epackage.registry.
>
> gr. Martin
>
> doux guillaume wrote:
>> Hi,
>>
>> I think I have solved my problem, I haven't correctly initialize my
>> new hbdatastore.
>>
>> It seems to be working.
>>
>> thanks
>>
>> guillaume
>>
>> doux guillaume wrote:
>>> Hi,
>>>
>>> In fact, I have to implement a model and meta-model repository with
>>> teneo. My model and meta-models are represented by a structure which
>>> contains a resource, with package inside for the meta-models and
>>> objects corresponding to a meta-model for the model.
>>> I store meta-data on separate table on the database to know that a model
>>> go with a metamodel.
>>>
>>> So, when I have to store a model in the repository, I retrieve the
>>> corresponding meta-model from the repository and then I get his
>>> epackage to register it from an HbDataStore and then save my model in
>>> this datastore. I have try to do this with only one datastore by
>>> reinitializing it, and also with a new datastore but I obtain always
>>> the same exception.
>>>
>>> I have seen by looking at the generated mapping some difference
>>> between the mapping generated after loading a meta-model from file or
>>> from teneo
>>> but it's not seem to be that.
>>>
>>> The most curious thing is that when I export a meta-model from Teneo
>>> to an ecore file, and then load it to register his packages and then
>>> persist my model with Teneo, it works fine.
>>>
>>> So I don't understand why it doesn't work.
>>>
>>> Thanks for the help,
>>>
>>> guillaume
>>>
>>>
>>> Martin Taal wrote:
>>>> Hi,
>>>> What do you mean with this step:
>>>> But when I retrieve a previously loaded meta-model from Teneo, and then
>>>> register his packages to the HbDataStore, I can't persist any model...
>>>>
>>>> What I understand is that you retrieve the epackage from Teneo (so
>>>> load it from the db) and register this epackage with another datastore?
>>>>
>>>> gr. Martin
>>>>
>>>> doux guillaume wrote:
>>>>> Hi,
>>>>>
>>>>> I'm always experiencing problems to add models corresponding to my
>>>>> meta-model in Teneo.
>>>>>
>>>>> If I create in a new class a new HbDataStore,
>>>>> load my meta-model from ecore files with my injectors,
>>>>> then register the package of my meta-model with
>>>>> setEPackage(mypackages),
>>>>> I can add my models to the HbDataStore with no problems, it works
>>>>> fine.
>>>>>
>>>>> But when I retrieve a previously loaded meta-model from Teneo, and
>>>>> then
>>>>> register his packages to the HbDataStore, I can't persist any model...
>>>>>
>>>>> I obtain this exception :
>>>>>
>>>>> found
>>>>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>>>>> java.lang.IllegalArgumentException: No annotated model element
>>>>> present for: Deb for type EClass has its epackage been registered
>>>>> with Teneo?
>>>>> at test.teneoRep.addModel(teneoRep.java:803)
>>>>> at test.testrepository.main(testrepository.java:103)
>>>>> Caused by: java.lang.IllegalArgumentException: No annotated model
>>>>> element present for: Deb for type EClass has its epackage been
>>>>> registered with Teneo?
>>>>> at
>>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>>>>
>>>>> at
>>>>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>>>>> at
>>>>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>>>>
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>>>
>>>>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>>>>> at test.teneoRep.addMo(teneoRep.java:296)
>>>>> at test.teneoRep.addM(teneoRep.java:327)
>>>>> at test.teneoRep.addModel(teneoRep.java:801)
>>>>> at test.testrepository.main(testrepository.java:103)
>>>>>
>>>>> I have tried many ways, but I obtain always the same exception.
>>>>>
>>>>> Can you help me ?
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> guillaume doux
>>>>
>>>>
>
>
|
|
|
Re: [TENEO] No annotated model element present [message #608824 is a reply to message #90949] |
Thu, 19 July 2007 15:54 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Guillaume,
Not much more than debug through the code. You can set a break point in the map method of the
AnnotationGenerator. This method receives an annotatedModel. The annotatedModel is a representation
of your epackages with additional jpa annotations.
The exception is thrown because the eclass Deb is not present in the annotatedmodel.
You can check if your epackages are actually present in the annotatedModel (look for the
AnnotatedElement member). Also check if they are the same instances, maybe your epackages are
present in memory multiple times.
If you can package it all in a eclipse project with a testcase then I can also try to reproduce it.
gr. Martin
doux guillaume wrote:
> Hi,
>
> I have tried to register my packages, who come from the deb in the
> epackage.registry.eINSTANCE but it doesn't work more...
>
> have you another idea ?
>
> thanks,
>
> guillaume
>
> Martin Taal wrote:
>> Hi Guillaume,
>> That's good, thanks for the update. One thing you should also do is
>> register the epackage, you read from the db, in the global
>> epackage.registry.
>>
>> gr. Martin
>>
>> doux guillaume wrote:
>>> Hi,
>>>
>>> I think I have solved my problem, I haven't correctly initialize my
>>> new hbdatastore.
>>>
>>> It seems to be working.
>>>
>>> thanks
>>>
>>> guillaume
>>>
>>> doux guillaume wrote:
>>>> Hi,
>>>>
>>>> In fact, I have to implement a model and meta-model repository with
>>>> teneo. My model and meta-models are represented by a structure which
>>>> contains a resource, with package inside for the meta-models and
>>>> objects corresponding to a meta-model for the model.
>>>> I store meta-data on separate table on the database to know that a
>>>> model
>>>> go with a metamodel.
>>>>
>>>> So, when I have to store a model in the repository, I retrieve the
>>>> corresponding meta-model from the repository and then I get his
>>>> epackage to register it from an HbDataStore and then save my model
>>>> in this datastore. I have try to do this with only one datastore by
>>>> reinitializing it, and also with a new datastore but I obtain always
>>>> the same exception.
>>>>
>>>> I have seen by looking at the generated mapping some difference
>>>> between the mapping generated after loading a meta-model from file
>>>> or from teneo
>>>> but it's not seem to be that.
>>>>
>>>> The most curious thing is that when I export a meta-model from Teneo
>>>> to an ecore file, and then load it to register his packages and then
>>>> persist my model with Teneo, it works fine.
>>>>
>>>> So I don't understand why it doesn't work.
>>>>
>>>> Thanks for the help,
>>>>
>>>> guillaume
>>>>
>>>>
>>>> Martin Taal wrote:
>>>>> Hi,
>>>>> What do you mean with this step:
>>>>> But when I retrieve a previously loaded meta-model from Teneo, and
>>>>> then
>>>>> register his packages to the HbDataStore, I can't persist any model...
>>>>>
>>>>> What I understand is that you retrieve the epackage from Teneo (so
>>>>> load it from the db) and register this epackage with another
>>>>> datastore?
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> doux guillaume wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I'm always experiencing problems to add models corresponding to my
>>>>>> meta-model in Teneo.
>>>>>>
>>>>>> If I create in a new class a new HbDataStore,
>>>>>> load my meta-model from ecore files with my injectors,
>>>>>> then register the package of my meta-model with
>>>>>> setEPackage(mypackages),
>>>>>> I can add my models to the HbDataStore with no problems, it works
>>>>>> fine.
>>>>>>
>>>>>> But when I retrieve a previously loaded meta-model from Teneo, and
>>>>>> then
>>>>>> register his packages to the HbDataStore, I can't persist any
>>>>>> model...
>>>>>>
>>>>>> I obtain this exception :
>>>>>>
>>>>>> found
>>>>>> org.eclipse.gmt.am3.core.storage.RepositoryException:
>>>>>> java.lang.IllegalArgumentException: No annotated model element
>>>>>> present for: Deb for type EClass has its epackage been registered
>>>>>> with Teneo?
>>>>>> at test.teneoRep.addModel(teneoRep.java:803)
>>>>>> at test.testrepository.main(testrepository.java:103)
>>>>>> Caused by: java.lang.IllegalArgumentException: No annotated model
>>>>>> element present for: Deb for type EClass has its epackage been
>>>>>> registered with Teneo?
>>>>>> at
>>>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:341)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:276)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.teneo.mapping.strategy.impl.EntityResolvingN ameStrategy.toEntityName(EntityResolvingNameStrategy.java:84 )
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.teneo.hibernate.EMFInterceptor.getEntityName (EMFInterceptor.java:55)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.impl.SessionImpl.guessEntityName(SessionImpl.j ava:1765)
>>>>>> at
>>>>>> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImp l.java:1338)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:96)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>>>>
>>>>>> at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
>>>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
>>>>>> at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
>>>>>> at test.teneoRep.addMo(teneoRep.java:296)
>>>>>> at test.teneoRep.addM(teneoRep.java:327)
>>>>>> at test.teneoRep.addModel(teneoRep.java:801)
>>>>>> at test.testrepository.main(testrepository.java:103)
>>>>>>
>>>>>> I have tried many ways, but I obtain always the same exception.
>>>>>>
>>>>>> Can you help me ?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> guillaume doux
>>>>>
>>>>>
>>
>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Goto Forum:
Current Time: Fri Apr 26 08:50:04 GMT 2024
Powered by FUDForum. Page generated in 0.04102 seconds
|