Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo1.0.3 requires EMF setter for one-to-many association
Teneo1.0.3 requires EMF setter for one-to-many association [message #136399] Thu, 14 May 2009 08:07
Ajay  is currently offline Ajay Friend
Messages: 12
Registered: July 2009
Junior Member
Hello Martin,

We are facing problem while migrating from Teneo1.0.1 to teneo1.0.3. Our
EMF
domain objects do not have setter method generated for one-to-many
associations
(default behavior of EMF). Teneo version1.0.1 was successfully able to
understand
the associations and hence everything was working fine.
e.g. saving/loading/updating of a domain object having a one-to-many
associations (cascade='all').
Recently we have migrated from Teneo 1.0.1 to Teneo1.0.3 and
all one-to-many association have stopped working.

We are getting the “org.hibernate.PropertyNotFoundException: Could not
find a setter for property emailAddresses in class
com.person.impl.PersonImpl” exception. But when we written the setter for
emailAddresses property manually in PersonImpl class, a new exception
"org.hibernate.PropertyAccessException: IllegalArgumentException occurred
while calling setter of com.person.impl.PersonImpl.emailAddresses” started
coming.

I am pasting the complete error logs below, coming in both scenarios:

************************************************************ ********************************
Error Log, when no setter for emailAddresses was available in PersonImpl
Class:

************************************************************ ********************************

java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at junit.framework.TestSuite.createTest(TestSuite.java:61)
at junit.framework.TestSuite.addTestMethod(TestSuite.java:283)
at junit.framework.TestSuite.<init>(TestSuite.java:146)
at
org.junit.internal.runners.OldTestClassRunner.<init>(OldTestClassRunner.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.junit.internal.requests.ClassRequest.buildRunner(ClassRe quest.java:33)
at
org.junit.internal.requests.ClassRequest.getRunner(ClassRequ est.java:28)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init >(JUnit4TestReference.java:28)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassRefere nce. <init>(JUnit4TestClassReference.java:24)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.crea teTest(JUnit4TestLoader.java:40)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.load Tests(JUnit4TestLoader.java:30)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:445)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'personDao' defined in class path resource
[spring-persistence-test.xml]: Cannot resolve reference to bean
'personSessionFactory' while setting bean property 'sessionFactory';
nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'personHbSessionDataStore' defined in class path resource
[spring-persistence-test.xml]: Instantiation of bean failed; nested
exception is
org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
com.server.core.persistence.teneo.PersonHbHelper.createRegis terDataStore(java.lang.String,org.hibernate.cfg.Configuratio n)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.PersonImpl
at
org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveReference(BeanDefinitionValueResolver.java: 275)
at
org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveValueIfNecessary(BeanDefinitionValueResolve r.java:104)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.applyPropertyValues(AbstractAutowireCapable BeanFactory.java:1245)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.populateBean(AbstractAutowireCapableBeanFac tory.java:1010)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:472)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBea nFactory.preInstantiateSingletons(DefaultListableBeanFactory .java:429)
at
org.springframework.context.support.AbstractApplicationConte xt.finishBeanFactoryInitialization(AbstractApplicationContex t.java:728)
at
org.springframework.context.support.AbstractApplicationConte xt.refresh(AbstractApplicationContext.java:380)
at
org.springframework.context.support.ClassPathXmlApplicationC ontext. <init>(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationC ontext. <init>(ClassPathXmlApplicationContext.java:83)
at com.person.test.TestPersonDAO.<clinit>(TestPersonDAO.java:93)

Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'personHbSessionDataStore' defined in class path
resource [spring-persistence-test.xml]: Instantiation of bean failed;
nested exception is
org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
com.server.core.persistence.teneo.PersonHbHelper.createRegis terDataStore(java.lang.String,org.hibernate.cfg.Configuratio n)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.PersonImpl
at
org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:444 )
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.instantiateUsingFactoryMethod(AbstractAutow ireCapableBeanFactory.java:903)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBeanInstance(AbstractAutowireCapableB eanFactory.java:817)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:440)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:287 )
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.instantiateUsingFactoryMethod(AbstractAutow ireCapableBeanFactory.java:903)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBeanInstance(AbstractAutowireCapableB eanFactory.java:817)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:440)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveReference(BeanDefinitionValueResolver.java: 269)

Caused by: org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
Factory method [public synchronized
org.eclipse.emf.teneo.hibernate.HbDataStore
com.server.core.persistence.teneo.PersonHbHelper.createRegis terDataStore(java.lang.String,org.hibernate.cfg.Configuratio n)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.PersonImpl
at
org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
at
org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )

Caused by: org.hibernate.PropertyNotFoundException: Could not find a
setter for property emailAddresses in class com.person.impl.PersonImpl
at
org.hibernate.property.BasicPropertyAccessor.createSetter(Ba sicPropertyAccessor.java:240)
at
org.hibernate.property.BasicPropertyAccessor.getSetter(Basic PropertyAccessor.java:233)
at org.hibernate.mapping.Property.getSetter(Property.java:299)
at
org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyS etter(PojoEntityTuplizer.java:272)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:149)
at
org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:76)
at
org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping . <init>(EntityEntityModeToTuplizerMapping.java:80)
at
org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:325)
at
org.hibernate.persister.entity.AbstractEntityPersister.<init >(AbstractEntityPersister.java:457)
at
org.hibernate.persister.entity.SingleTableEntityPersister.<init >(SingleTableEntityPersister.java:131)
at
org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:84)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1327)
at
com.server.core.persistence.teneo.PersonHbSessionDataStore.b uildSessionFactory(PersonHbSessionDataStore.java:232)

at
com.server.core.persistence.teneo.PersonHbSessionDataStore.i nitialize(PersonHbSessionDataStore.java:112)
at
com.server.core.persistence.teneo.PersonHbHelper.createRegis terDataStore(PersonHbHelper.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:115)


************************************************************ ********************************
Error Log after writing setter for emailAddresses in PersonImpl Class
manually:

************************************************************ ********************************

1938 [main] ERROR org.hibernate.property.BasicPropertyAccessor - expected
type: org.eclipse.emf.common.util.EList,
actual value: org.hibernate.collection.PersistentBag

Exception in thread "main" org.hibernate.PropertyAccessException:
IllegalArgumentException occurred while calling setter of
com.person.impl.PersonImpl.emailAddresses
at
org.hibernate.property.BasicPropertyAccessor$BasicSetter.set (BasicPropertyAccessor.java:128)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropert yValues(AbstractEntityTuplizer.java:360)
at
org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyVal ues(PojoEntityTuplizer.java:221)
at
org.hibernate.persister.entity.AbstractEntityPersister.setPr opertyValues(AbstractEntityPersister.java:3594)
at
org.hibernate.event.def.DefaultFlushEntityEventListener.onFl ushEntity(DefaultFlushEntityEventListener.java:156)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushE ntities(AbstractFlushingEventListener.java:219)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:99)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:49)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java :365)
at
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransac tion.java:137)
at
com.person.test.TestPersonDAO.testSaveWithoutIdAndVersno(Tes tPersonDAO.java:386)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.OldTestClassRunner.run(OldTestCla ssRunner.java:76)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:45)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.hibernate.property.BasicPropertyAccessor$BasicSetter.set (BasicPropertyAccessor.java:66)
Previous Topic:[EMF Compare] Pb comparing a SysML model using SVN
Next Topic:Teneo1.0.3 requires EMF setter for one-to-many association
Goto Forum:
  


Current Time: Fri Apr 19 21:52:39 GMT 2024

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

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

Back to the top