Home » Modeling » EMF » Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #430786 is a reply to message #430616] |
Wed, 10 June 2009 11:25 |
Ajay Messages: 12 Registered: July 2009 |
Junior Member |
|
|
Hello Martin,
I am using two EMF classes and two DAOs (one for Employee and other one
for EmailAddresses) for performimg operations on EMF objects.
Testcases for both Employee and EmailAddresses are working fine with
Teneo1.0.1 libraries but asking "setters" for EList type attributes while
running test cases using Teneo 1.0.3 libraries.
The generated interfaces are as follows:
1.EmailAddresses
2.Employee
The generated implementation classes are as follows:
1.EmailAddressesImpl
2.EmployeeImpl
Two DAOs:
1. DAO_Employee
2. DAO_EmailAddress
The association between Employee and EmailAddresses is a bidirectional
one-to-many relationship.
I am pasting complete Hbm file, Test class and Exception Log for your
perusal.
Hbm for these two classes are listed below:
**************************************************
<?xml version="1.0" encoding="UTF-8"?>
<!-- Hibernate XML Mapping File -->
<!-- Author: U129098 -->
<!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="true">
<class
name="com.person.impl.EmployeeImpl"
table="employee" entity-name="Employee" mutable="true"
dynamic-update="false"
dynamic-insert="false" select-before-update="false" lazy="false"
abstract="false">
<id name="personId" column="employee_id">
<generator class="increment" />
</id>
<property name="name" insert="true" update="true" lazy="false"
optimistic-lock="true" not-null="true">
<column name="name" sql-type="varchar" not-null="true" />
</property>
<bag name="emailAddresses" lazy="true" table="email_address"
fetch="select" cascade="all" inverse="true">
<key column="owner_id" />
<one-to-many class="com.person.impl.EmailAddressesImpl"
entity-name="EmailAddresses" />
</bag>
</class>
<class
name="com.person.impl.EmailAddressesImpl"
table="email_address" entity-name="EmailAddresses" mutable="true"
dynamic-update="false"
dynamic-insert="false" select-before-update="false" lazy="false"
abstract="false">
<id name="emailId" column="email_id">
<generator class="increment" />
</id>
<property name="emailAddress" insert="true" update="true"
lazy="false" optimistic-lock="true">
<column name="email_address" sql-type="varchar" not-null="true" />
</property>
<many-to-one name="owner" column="owner_id"
not-null="true"
class="com.person.impl.EmployeeImpl"
lazy="proxy" entity-name="Employee" cascade="all"/>
</class>
</hibernate-mapping>
**************************************************
TestClass for Employee class:
***************************************************
public class EmployeeMappingTest {
protected static final String CONTEXT_FILE_NAME = "spring.xml";
protected static final ConfigurableApplicationContext springContext = new
ClassPathXmlApplicationContext(
CONTEXT_FILE_NAME);
DAO_Employee employeeDAO = null;
SessionFactory sessionFactory = null;
/**
* SetUp method
*/
@Before
public void setUp() throws Exception {
employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
sessionFactory = (SessionFactory) springContext
.getBean("sessionFactory");
}
@After
public void tearDown() throws Exception {
employeeDAO = null;
sessionFactory = null;
}
/**
* Test method for saving an Employee object
*/
@Test
public void testSaveEmployee() {
Employee employee = new EmployeeImpl();
EmailAddresses emailAddress = new EmailAddressesImpl();
emailAddress.setEmailAddress("ajay.chauhan@ps.net");
emailAddress.setOwner(employee);
EmailAddresses emailAddress1 = new EmailAddressesImpl();
emailAddress1.setEmailAddress("call2aps@gmail.com");
emailAddress1.setOwner(employee);
List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
eList.add(emailAddress);
eList.add(emailAddress1);
employee.setName("Ajay Chauhan");
employee.getEmailAddresses().addAll(eList);
try {
Transaction tx = sessionFactory.getCurrentSession()
.beginTransaction();
employeeDAO.save(employee);
tx.commit();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Test method for Load
*/
@Test
public void testLoadByIdID_Employee() {
// set the existing id
Integer id = 1;
Employee obj = null;
try {
Transaction txn = sessionFactory.getCurrentSession()
.beginTransaction();
obj = (Employee) sessionFactory.getCurrentSession().get("Employee",id,
LockMode.READ);
System.out.println("Employee ID :: " + obj.getPersonId());
System.out.println("Employee Name :: " + obj.getName());
List<EmailAddresses> eList = obj.getEmailAddresses();
for (EmailAddresses email : eList) {
System.out.println("Email ID :: " + email.getEmailId());
System.out.println("Email Address :: "
+ email.getEmailAddress());
}
txn.commit();
} catch (Exception e) {
e.printStackTrace();
}
}
}
*********************************************************
Exceptions are:
**********************************************************
log4j:WARN No appenders could be found for logger
(org.springframework.context.support.ClassPathXmlApplication Context).
log4j:WARN Please initialize the log4j system properly.
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
org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
at
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
at
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
at
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
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: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'employeeDAO' defined in class path resource
[spring.xml]: Cannot resolve reference to bean 'employeeSessionFactory'
while setting bean property 'sessionFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'employeeHbSessionDataStore' defined in class path resource
[spring.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.person.teneo.
EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.EmployeeImpl
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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
... 16 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'employeeHbSessionDataStore' defined in class path
resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.EmployeeImpl
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)
... 34 more
Caused by: org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
Factory method [public synchronized
org.eclipse.emf.teneo.hibernate.HbDataStore
com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.EmployeeImpl
at
org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
at
org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
... 58 more
Caused by: org.hibernate.PropertyNotFoundException: Could not find a
setter for property emailAddresses in class com.person.impl.EmployeeImpl
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.person.teneo.
EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
at com.person.teneo.
EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
at
com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
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)
... 59 more
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #430788 is a reply to message #430786] |
Wed, 10 June 2009 12:05 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Ajay,
It does not seem to use the EMFTuplizer but the standard PojoEntityTuplizer:
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)
The tuplizer creates the accessors (setters/getters) used by Hibernate.
Can you check/debug if the HbDataStore.setTuplizer() is called and what it does?
gr. Martin
Ajay Chauhan wrote:
> Hello Martin,
>
> I am using two EMF classes and two DAOs (one for Employee and other one
> for EmailAddresses) for performimg operations on EMF objects.
>
> Testcases for both Employee and EmailAddresses are working fine with
> Teneo1.0.1 libraries but asking "setters" for EList type attributes
> while running test cases using Teneo 1.0.3 libraries.
>
> The generated interfaces are as follows:
> 1.EmailAddresses
> 2.Employee
>
> The generated implementation classes are as follows:
> 1.EmailAddressesImpl
> 2.EmployeeImpl
>
> Two DAOs:
> 1. DAO_Employee
> 2. DAO_EmailAddress
>
> The association between Employee and EmailAddresses is a bidirectional
> one-to-many relationship.
>
> I am pasting complete Hbm file, Test class and Exception Log for your
> perusal.
>
> Hbm for these two classes are listed below:
> **************************************************
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- Hibernate XML Mapping File -->
> <!-- Author: U129098 -->
> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping auto-import="true">
> <class
> name="com.person.impl.EmployeeImpl"
> table="employee" entity-name="Employee" mutable="true"
> dynamic-update="false"
> dynamic-insert="false" select-before-update="false" lazy="false"
> abstract="false">
> <id name="personId" column="employee_id">
> <generator class="increment" />
> </id>
> <property name="name" insert="true" update="true" lazy="false"
> optimistic-lock="true" not-null="true">
> <column name="name" sql-type="varchar" not-null="true" />
> </property>
> <bag name="emailAddresses" lazy="true" table="email_address"
> fetch="select" cascade="all" inverse="true">
> <key column="owner_id" />
> <one-to-many class="com.person.impl.EmailAddressesImpl"
> entity-name="EmailAddresses" />
> </bag>
> </class>
>
> <class
> name="com.person.impl.EmailAddressesImpl"
> table="email_address" entity-name="EmailAddresses"
> mutable="true" dynamic-update="false"
> dynamic-insert="false" select-before-update="false" lazy="false"
> abstract="false">
> <id name="emailId" column="email_id">
> <generator class="increment" />
> </id>
> <property name="emailAddress" insert="true" update="true"
> lazy="false" optimistic-lock="true">
> <column name="email_address" sql-type="varchar"
> not-null="true" />
> </property>
> <many-to-one name="owner" column="owner_id"
> not-null="true"
> class="com.person.impl.EmployeeImpl"
> lazy="proxy" entity-name="Employee" cascade="all"/>
> </class>
> </hibernate-mapping>
>
> **************************************************
>
> TestClass for Employee class:
>
> ***************************************************
>
> public class EmployeeMappingTest {
> protected static final String CONTEXT_FILE_NAME = "spring.xml";
> protected static final ConfigurableApplicationContext springContext
> = new ClassPathXmlApplicationContext(
> CONTEXT_FILE_NAME);
>
> DAO_Employee employeeDAO = null;
> SessionFactory sessionFactory = null;
>
> /**
> * SetUp method
> */
> @Before
> public void setUp() throws Exception {
> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
> sessionFactory = (SessionFactory) springContext
> .getBean("sessionFactory");
>
> }
>
> @After
> public void tearDown() throws Exception {
> employeeDAO = null;
> sessionFactory = null;
> }
>
> /**
> * Test method for saving an Employee object
> */
> @Test
> public void testSaveEmployee() {
>
>
> Employee employee = new EmployeeImpl();
> EmailAddresses emailAddress = new EmailAddressesImpl();
> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
> emailAddress.setOwner(employee);
> EmailAddresses emailAddress1 = new EmailAddressesImpl();
> emailAddress1.setEmailAddress("call2aps@gmail.com");
> emailAddress1.setOwner(employee);
> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
> eList.add(emailAddress);
> eList.add(emailAddress1);
>
> employee.setName("Ajay Chauhan");
> employee.getEmailAddresses().addAll(eList);
>
> try {
> Transaction tx = sessionFactory.getCurrentSession()
> .beginTransaction();
> employeeDAO.save(employee);
>
> tx.commit();
> } catch (Exception e) {
> e.printStackTrace();
> } }
>
> /**
> * Test method for Load
> */
> @Test
> public void testLoadByIdID_Employee() {
>
> // set the existing id
> Integer id = 1;
>
>
> Employee obj = null;
>
> try {
> Transaction txn = sessionFactory.getCurrentSession()
> .beginTransaction();
> obj = (Employee)
> sessionFactory.getCurrentSession().get("Employee",id, LockMode.READ);
>
> System.out.println("Employee ID :: " + obj.getPersonId());
> System.out.println("Employee Name :: " + obj.getName());
>
> List<EmailAddresses> eList = obj.getEmailAddresses();
> for (EmailAddresses email : eList) {
> System.out.println("Email ID :: " + email.getEmailId());
> System.out.println("Email Address :: "
> + email.getEmailAddress());
> }
> txn.commit();
>
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> }
> *********************************************************
>
>
> Exceptions are:
>
> **********************************************************
>
>
> log4j:WARN No appenders could be found for logger
> (org.springframework.context.support.ClassPathXmlApplication Context).
> log4j:WARN Please initialize the log4j system properly.
> 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
> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>
> at
> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>
> at
> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>
> at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
> 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: org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'employeeDAO' defined in class path
> resource [spring.xml]: Cannot resolve reference to bean
> 'employeeSessionFactory' while setting bean property 'sessionFactory';
> nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'employeeHbSessionDataStore' defined in class path
> resource [spring.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.person.teneo.
> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
> ... 16 more
> Caused by: org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'employeeHbSessionDataStore' defined in
> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> 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)
>
> ... 34 more
> Caused by:
> org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
> method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> at
> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>
> at
> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>
> ... 58 more
> Caused by: org.hibernate.PropertyNotFoundException: Could not find a
> setter for property emailAddresses in class com.person.impl.EmployeeImpl
> 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.person.teneo.
> EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
>
> at com.person.teneo.
> EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
> at
> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
>
> 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)
>
> ... 59 more
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #430792 is a reply to message #430786] |
Wed, 10 June 2009 13:31 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
This post has been answered on the main EMF newsgroup.
gr. Martin
Ajay Chauhan wrote:
> Hello Martin,
>
> I am using two EMF classes and two DAOs (one for Employee and other one
> for EmailAddresses) for performimg operations on EMF objects.
>
> Testcases for both Employee and EmailAddresses are working fine with
> Teneo1.0.1 libraries but asking "setters" for EList type attributes
> while running test cases using Teneo 1.0.3 libraries.
>
> The generated interfaces are as follows:
> 1.EmailAddresses
> 2.Employee
>
> The generated implementation classes are as follows:
> 1.EmailAddressesImpl
> 2.EmployeeImpl
>
> Two DAOs:
> 1. DAO_Employee
> 2. DAO_EmailAddress
>
> The association between Employee and EmailAddresses is a bidirectional
> one-to-many relationship.
>
> I am pasting complete Hbm file, Test class and Exception Log for your
> perusal.
>
> Hbm for these two classes are listed below:
> **************************************************
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- Hibernate XML Mapping File -->
> <!-- Author: U129098 -->
> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping auto-import="true">
> <class
> name="com.person.impl.EmployeeImpl"
> table="employee" entity-name="Employee" mutable="true"
> dynamic-update="false"
> dynamic-insert="false" select-before-update="false" lazy="false"
> abstract="false">
> <id name="personId" column="employee_id">
> <generator class="increment" />
> </id>
> <property name="name" insert="true" update="true" lazy="false"
> optimistic-lock="true" not-null="true">
> <column name="name" sql-type="varchar" not-null="true" />
> </property>
> <bag name="emailAddresses" lazy="true" table="email_address"
> fetch="select" cascade="all" inverse="true">
> <key column="owner_id" />
> <one-to-many class="com.person.impl.EmailAddressesImpl"
> entity-name="EmailAddresses" />
> </bag>
> </class>
>
> <class
> name="com.person.impl.EmailAddressesImpl"
> table="email_address" entity-name="EmailAddresses"
> mutable="true" dynamic-update="false"
> dynamic-insert="false" select-before-update="false" lazy="false"
> abstract="false">
> <id name="emailId" column="email_id">
> <generator class="increment" />
> </id>
> <property name="emailAddress" insert="true" update="true"
> lazy="false" optimistic-lock="true">
> <column name="email_address" sql-type="varchar"
> not-null="true" />
> </property>
> <many-to-one name="owner" column="owner_id"
> not-null="true"
> class="com.person.impl.EmployeeImpl"
> lazy="proxy" entity-name="Employee" cascade="all"/>
> </class>
> </hibernate-mapping>
>
> **************************************************
>
> TestClass for Employee class:
>
> ***************************************************
>
> public class EmployeeMappingTest {
> protected static final String CONTEXT_FILE_NAME = "spring.xml";
> protected static final ConfigurableApplicationContext springContext
> = new ClassPathXmlApplicationContext(
> CONTEXT_FILE_NAME);
>
> DAO_Employee employeeDAO = null;
> SessionFactory sessionFactory = null;
>
> /**
> * SetUp method
> */
> @Before
> public void setUp() throws Exception {
> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
> sessionFactory = (SessionFactory) springContext
> .getBean("sessionFactory");
>
> }
>
> @After
> public void tearDown() throws Exception {
> employeeDAO = null;
> sessionFactory = null;
> }
>
> /**
> * Test method for saving an Employee object
> */
> @Test
> public void testSaveEmployee() {
>
>
> Employee employee = new EmployeeImpl();
> EmailAddresses emailAddress = new EmailAddressesImpl();
> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
> emailAddress.setOwner(employee);
> EmailAddresses emailAddress1 = new EmailAddressesImpl();
> emailAddress1.setEmailAddress("call2aps@gmail.com");
> emailAddress1.setOwner(employee);
> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
> eList.add(emailAddress);
> eList.add(emailAddress1);
>
> employee.setName("Ajay Chauhan");
> employee.getEmailAddresses().addAll(eList);
>
> try {
> Transaction tx = sessionFactory.getCurrentSession()
> .beginTransaction();
> employeeDAO.save(employee);
>
> tx.commit();
> } catch (Exception e) {
> e.printStackTrace();
> } }
>
> /**
> * Test method for Load
> */
> @Test
> public void testLoadByIdID_Employee() {
>
> // set the existing id
> Integer id = 1;
>
>
> Employee obj = null;
>
> try {
> Transaction txn = sessionFactory.getCurrentSession()
> .beginTransaction();
> obj = (Employee)
> sessionFactory.getCurrentSession().get("Employee",id, LockMode.READ);
>
> System.out.println("Employee ID :: " + obj.getPersonId());
> System.out.println("Employee Name :: " + obj.getName());
>
> List<EmailAddresses> eList = obj.getEmailAddresses();
> for (EmailAddresses email : eList) {
> System.out.println("Email ID :: " + email.getEmailId());
> System.out.println("Email Address :: "
> + email.getEmailAddress());
> }
> txn.commit();
>
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> }
> *********************************************************
>
>
> Exceptions are:
>
> **********************************************************
>
>
> log4j:WARN No appenders could be found for logger
> (org.springframework.context.support.ClassPathXmlApplication Context).
> log4j:WARN Please initialize the log4j system properly.
> 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
> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>
> at
> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>
> at
> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>
> at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
> 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: org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'employeeDAO' defined in class path
> resource [spring.xml]: Cannot resolve reference to bean
> 'employeeSessionFactory' while setting bean property 'sessionFactory';
> nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'employeeHbSessionDataStore' defined in class path
> resource [spring.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.person.teneo.
> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
> ... 16 more
> Caused by: org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'employeeHbSessionDataStore' defined in
> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> 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)
>
> ... 34 more
> Caused by:
> org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
> method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> at
> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>
> at
> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>
> ... 58 more
> Caused by: org.hibernate.PropertyNotFoundException: Could not find a
> setter for property emailAddresses in class com.person.impl.EmployeeImpl
> 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.person.teneo.
> EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
>
> at com.person.teneo.
> EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
> at
> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
>
> 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)
>
> ... 59 more
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #636439 is a reply to message #430788] |
Mon, 01 November 2010 10:00 |
Daniel Messages: 16 Registered: June 2010 |
Junior Member |
|
|
Hello Martin,
I have the same problem and tried to debug into the setTuplizer method.
I.e. I
- started jboss 5.1
- started remote eclipse debugging session
- set a breakpoint at HbDataStore.setTuplizer()
- redeployed my package into default/deploy
As my eclipse doesn't start to blink and I don't see the debugger
activated the breakpoint I assume the HbDataStore.setTuplizer is not called.
Do you (or somebody else) have a solution please?
Thank you
Daniel
Am 10.06.2009 14:05, schrieb Martin Taal:
> Hi Ajay,
> It does not seem to use the EMFTuplizer but the standard
> PojoEntityTuplizer:
>
> 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)
>
>
> The tuplizer creates the accessors (setters/getters) used by Hibernate.
>
> Can you check/debug if the HbDataStore.setTuplizer() is called and what
> it does?
>
> gr. Martin
>
> Ajay Chauhan wrote:
>> Hello Martin,
>>
>> I am using two EMF classes and two DAOs (one for Employee and other
>> one for EmailAddresses) for performimg operations on EMF objects.
>>
>> Testcases for both Employee and EmailAddresses are working fine with
>> Teneo1.0.1 libraries but asking "setters" for EList type attributes
>> while running test cases using Teneo 1.0.3 libraries.
>>
>> The generated interfaces are as follows:
>> 1.EmailAddresses
>> 2.Employee
>>
>> The generated implementation classes are as follows:
>> 1.EmailAddressesImpl
>> 2.EmployeeImpl
>>
>> Two DAOs:
>> 1. DAO_Employee
>> 2. DAO_EmailAddress
>>
>> The association between Employee and EmailAddresses is a bidirectional
>> one-to-many relationship.
>>
>> I am pasting complete Hbm file, Test class and Exception Log for your
>> perusal.
>>
>> Hbm for these two classes are listed below:
>> **************************************************
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!-- Hibernate XML Mapping File -->
>> <!-- Author: U129098 -->
>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>> <!DOCTYPE hibernate-mapping PUBLIC
>> "-//Hibernate/Hibernate Mapping DTD//EN"
>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>> <hibernate-mapping auto-import="true">
>> <class
>> name="com.person.impl.EmployeeImpl"
>> table="employee" entity-name="Employee" mutable="true"
>> dynamic-update="false"
>> dynamic-insert="false" select-before-update="false" lazy="false"
>> abstract="false">
>> <id name="personId" column="employee_id">
>> <generator class="increment" />
>> </id>
>> <property name="name" insert="true" update="true" lazy="false"
>> optimistic-lock="true" not-null="true">
>> <column name="name" sql-type="varchar" not-null="true" />
>> </property>
>> <bag name="emailAddresses" lazy="true" table="email_address"
>> fetch="select" cascade="all" inverse="true">
>> <key column="owner_id" />
>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>> entity-name="EmailAddresses" /> </bag>
>> </class>
>> <class
>> name="com.person.impl.EmailAddressesImpl"
>> table="email_address" entity-name="EmailAddresses" mutable="true"
>> dynamic-update="false"
>> dynamic-insert="false" select-before-update="false" lazy="false"
>> abstract="false">
>> <id name="emailId" column="email_id">
>> <generator class="increment" />
>> </id>
>> <property name="emailAddress" insert="true" update="true"
>> lazy="false" optimistic-lock="true">
>> <column name="email_address" sql-type="varchar" not-null="true" />
>> </property>
>> <many-to-one name="owner" column="owner_id"
>> not-null="true"
>> class="com.person.impl.EmployeeImpl"
>> lazy="proxy" entity-name="Employee" cascade="all"/>
>> </class>
>> </hibernate-mapping>
>>
>> **************************************************
>>
>> TestClass for Employee class:
>>
>> ***************************************************
>>
>> public class EmployeeMappingTest {
>> protected static final String CONTEXT_FILE_NAME = "spring.xml";
>> protected static final ConfigurableApplicationContext springContext =
>> new ClassPathXmlApplicationContext(
>> CONTEXT_FILE_NAME);
>> DAO_Employee employeeDAO = null;
>> SessionFactory sessionFactory = null;
>>
>> /**
>> * SetUp method
>> */
>> @Before
>> public void setUp() throws Exception {
>> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
>> sessionFactory = (SessionFactory) springContext
>> .getBean("sessionFactory");
>> }
>>
>> @After
>> public void tearDown() throws Exception {
>> employeeDAO = null;
>> sessionFactory = null;
>> }
>>
>> /**
>> * Test method for saving an Employee object
>> */
>> @Test
>> public void testSaveEmployee() {
>>
>> Employee employee = new EmployeeImpl();
>> EmailAddresses emailAddress = new EmailAddressesImpl();
>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>> emailAddress.setOwner(employee);
>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>> emailAddress1.setOwner(employee);
>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>> eList.add(emailAddress);
>> eList.add(emailAddress1);
>>
>> employee.setName("Ajay Chauhan");
>> employee.getEmailAddresses().addAll(eList);
>>
>> try {
>> Transaction tx = sessionFactory.getCurrentSession()
>> .beginTransaction();
>> employeeDAO.save(employee);
>> tx.commit();
>> } catch (Exception e) {
>> e.printStackTrace();
>> } }
>>
>> /**
>> * Test method for Load
>> */
>> @Test
>> public void testLoadByIdID_Employee() {
>>
>> // set the existing id
>> Integer id = 1;
>>
>> Employee obj = null;
>>
>> try {
>> Transaction txn = sessionFactory.getCurrentSession()
>> .beginTransaction();
>> obj = (Employee) sessionFactory.getCurrentSession().get("Employee",id,
>> LockMode.READ);
>>
>> System.out.println("Employee ID :: " + obj.getPersonId());
>> System.out.println("Employee Name :: " + obj.getName());
>>
>> List<EmailAddresses> eList = obj.getEmailAddresses();
>> for (EmailAddresses email : eList) {
>> System.out.println("Email ID :: " + email.getEmailId());
>> System.out.println("Email Address :: "
>> + email.getEmailAddress());
>> }
>> txn.commit();
>>
>> } catch (Exception e) {
>> e.printStackTrace();
>> }
>> }
>>
>> }
>> *********************************************************
>>
>>
>> Exceptions are:
>>
>> **********************************************************
>>
>>
>> log4j:WARN No appenders could be found for logger
>> (org.springframework.context.support.ClassPathXmlApplication Context).
>> log4j:WARN Please initialize the log4j system properly.
>> 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
>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>
>> at
>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>
>> at
>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>
>> at
>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>
>> at
>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>
>> at
>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>> 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: org.springframework.beans.factory.BeanCreationException:
>> Error creating bean with name 'employeeDAO' defined in class path
>> resource [spring.xml]: Cannot resolve reference to bean
>> 'employeeSessionFactory' while setting bean property 'sessionFactory';
>> nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'employeeHbSessionDataStore' defined in class
>> path resource [spring.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.person.teneo.
>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>> threw exception; nested exception is
>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>> property emailAddresses in class com.person.impl.EmployeeImpl
>> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
>> ... 16 more
>> Caused by: org.springframework.beans.factory.BeanCreationException:
>> Error creating bean with name 'employeeHbSessionDataStore' defined in
>> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>> threw exception; nested exception is
>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>> property emailAddresses in class com.person.impl.EmployeeImpl
>> 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)
>>
>> ... 34 more
>> Caused by:
>> org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
>> Factory method [public synchronized
>> org.eclipse.emf.teneo.hibernate.HbDataStore
>> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>> threw exception; nested exception is
>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>> property emailAddresses in class com.person.impl.EmployeeImpl
>> at
>> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>>
>> at
>> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>>
>> ... 58 more
>> Caused by: org.hibernate.PropertyNotFoundException: Could not find a
>> setter for property emailAddresses in class com.person.impl.EmployeeImpl
>> 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.person.teneo.
>> EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
>>
>> at com.person.teneo.
>> EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
>>
>> at
>> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
>>
>> 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)
>>
>> ... 59 more
>>
>>
>
>
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #636440 is a reply to message #636439] |
Mon, 01 November 2010 10:16 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Daniel,
Hmm, it remains a strange thing as the setTuplizer is called from initialize. Can you set the breakpoint a bit earlier
in the process in the HbDataStore.initializeDataStore method?
Which version of Teneo are you using?
gr. Martin
On 11/01/2010 11:00 AM, Daniel Winz wrote:
> Hello Martin,
>
> I have the same problem and tried to debug into the setTuplizer method.
>
> I.e. I
> - started jboss 5.1
> - started remote eclipse debugging session
> - set a breakpoint at HbDataStore.setTuplizer()
> - redeployed my package into default/deploy
>
> As my eclipse doesn't start to blink and I don't see the debugger
> activated the breakpoint I assume the HbDataStore.setTuplizer is not
> called.
>
> Do you (or somebody else) have a solution please?
>
> Thank you
> Daniel
>
>
>
>
> Am 10.06.2009 14:05, schrieb Martin Taal:
>> Hi Ajay,
>> It does not seem to use the EMFTuplizer but the standard
>> PojoEntityTuplizer:
>>
>> 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)
>>
>>
>>
>> The tuplizer creates the accessors (setters/getters) used by Hibernate.
>>
>> Can you check/debug if the HbDataStore.setTuplizer() is called and what
>> it does?
>>
>> gr. Martin
>>
>> Ajay Chauhan wrote:
>>> Hello Martin,
>>>
>>> I am using two EMF classes and two DAOs (one for Employee and other
>>> one for EmailAddresses) for performimg operations on EMF objects.
>>>
>>> Testcases for both Employee and EmailAddresses are working fine with
>>> Teneo1.0.1 libraries but asking "setters" for EList type attributes
>>> while running test cases using Teneo 1.0.3 libraries.
>>>
>>> The generated interfaces are as follows:
>>> 1.EmailAddresses
>>> 2.Employee
>>>
>>> The generated implementation classes are as follows:
>>> 1.EmailAddressesImpl
>>> 2.EmployeeImpl
>>>
>>> Two DAOs:
>>> 1. DAO_Employee
>>> 2. DAO_EmailAddress
>>>
>>> The association between Employee and EmailAddresses is a bidirectional
>>> one-to-many relationship.
>>>
>>> I am pasting complete Hbm file, Test class and Exception Log for your
>>> perusal.
>>>
>>> Hbm for these two classes are listed below:
>>> **************************************************
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!-- Hibernate XML Mapping File -->
>>> <!-- Author: U129098 -->
>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>> <!DOCTYPE hibernate-mapping PUBLIC
>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>> <hibernate-mapping auto-import="true">
>>> <class
>>> name="com.person.impl.EmployeeImpl"
>>> table="employee" entity-name="Employee" mutable="true"
>>> dynamic-update="false"
>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>> abstract="false">
>>> <id name="personId" column="employee_id">
>>> <generator class="increment" />
>>> </id>
>>> <property name="name" insert="true" update="true" lazy="false"
>>> optimistic-lock="true" not-null="true">
>>> <column name="name" sql-type="varchar" not-null="true" />
>>> </property>
>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>> fetch="select" cascade="all" inverse="true">
>>> <key column="owner_id" />
>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>> entity-name="EmailAddresses" /> </bag>
>>> </class>
>>> <class
>>> name="com.person.impl.EmailAddressesImpl"
>>> table="email_address" entity-name="EmailAddresses" mutable="true"
>>> dynamic-update="false"
>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>> abstract="false">
>>> <id name="emailId" column="email_id">
>>> <generator class="increment" />
>>> </id>
>>> <property name="emailAddress" insert="true" update="true"
>>> lazy="false" optimistic-lock="true">
>>> <column name="email_address" sql-type="varchar" not-null="true" />
>>> </property>
>>> <many-to-one name="owner" column="owner_id"
>>> not-null="true"
>>> class="com.person.impl.EmployeeImpl"
>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>> </class>
>>> </hibernate-mapping>
>>>
>>> **************************************************
>>>
>>> TestClass for Employee class:
>>>
>>> ***************************************************
>>>
>>> public class EmployeeMappingTest {
>>> protected static final String CONTEXT_FILE_NAME = "spring.xml";
>>> protected static final ConfigurableApplicationContext springContext =
>>> new ClassPathXmlApplicationContext(
>>> CONTEXT_FILE_NAME);
>>> DAO_Employee employeeDAO = null;
>>> SessionFactory sessionFactory = null;
>>>
>>> /**
>>> * SetUp method
>>> */
>>> @Before
>>> public void setUp() throws Exception {
>>> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
>>> sessionFactory = (SessionFactory) springContext
>>> .getBean("sessionFactory");
>>> }
>>>
>>> @After
>>> public void tearDown() throws Exception {
>>> employeeDAO = null;
>>> sessionFactory = null;
>>> }
>>>
>>> /**
>>> * Test method for saving an Employee object
>>> */
>>> @Test
>>> public void testSaveEmployee() {
>>>
>>> Employee employee = new EmployeeImpl();
>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>> emailAddress.setOwner(employee);
>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>> emailAddress1.setOwner(employee);
>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>> eList.add(emailAddress);
>>> eList.add(emailAddress1);
>>>
>>> employee.setName("Ajay Chauhan");
>>> employee.getEmailAddresses().addAll(eList);
>>>
>>> try {
>>> Transaction tx = sessionFactory.getCurrentSession()
>>> .beginTransaction();
>>> employeeDAO.save(employee);
>>> tx.commit();
>>> } catch (Exception e) {
>>> e.printStackTrace();
>>> } }
>>>
>>> /**
>>> * Test method for Load
>>> */
>>> @Test
>>> public void testLoadByIdID_Employee() {
>>>
>>> // set the existing id
>>> Integer id = 1;
>>>
>>> Employee obj = null;
>>>
>>> try {
>>> Transaction txn = sessionFactory.getCurrentSession()
>>> .beginTransaction();
>>> obj = (Employee) sessionFactory.getCurrentSession().get("Employee",id,
>>> LockMode.READ);
>>>
>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>> System.out.println("Employee Name :: " + obj.getName());
>>>
>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>> for (EmailAddresses email : eList) {
>>> System.out.println("Email ID :: " + email.getEmailId());
>>> System.out.println("Email Address :: "
>>> + email.getEmailAddress());
>>> }
>>> txn.commit();
>>>
>>> } catch (Exception e) {
>>> e.printStackTrace();
>>> }
>>> }
>>>
>>> }
>>> *********************************************************
>>>
>>>
>>> Exceptions are:
>>>
>>> **********************************************************
>>>
>>>
>>> log4j:WARN No appenders could be found for logger
>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>> log4j:WARN Please initialize the log4j system properly.
>>> 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
>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>
>>>
>>> at
>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>
>>>
>>> at
>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>
>>>
>>> at
>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>
>>>
>>> at
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>
>>>
>>> at
>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>> 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: org.springframework.beans.factory.BeanCreationException:
>>> Error creating bean with name 'employeeDAO' defined in class path
>>> resource [spring.xml]: Cannot resolve reference to bean
>>> 'employeeSessionFactory' while setting bean property 'sessionFactory';
>>> nested exception is
>>> org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name 'employeeHbSessionDataStore' defined in class
>>> path resource [spring.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.person.teneo.
>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>
>>> threw exception; nested exception is
>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
>>>
>>> ... 16 more
>>> Caused by: org.springframework.beans.factory.BeanCreationException:
>>> Error creating bean with name 'employeeHbSessionDataStore' defined in
>>> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>
>>> threw exception; nested exception is
>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>> 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)
>>>
>>>
>>> ... 34 more
>>> Caused by:
>>> org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
>>> Factory method [public synchronized
>>> org.eclipse.emf.teneo.hibernate.HbDataStore
>>> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>
>>> threw exception; nested exception is
>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>> at
>>> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>>>
>>>
>>> at
>>> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>>>
>>>
>>> ... 58 more
>>> Caused by: org.hibernate.PropertyNotFoundException: Could not find a
>>> setter for property emailAddresses in class com.person.impl.EmployeeImpl
>>> 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.person.teneo.
>>> EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
>>>
>>>
>>> at com.person.teneo.
>>> EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
>>>
>>>
>>> at
>>> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
>>>
>>>
>>> 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)
>>>
>>>
>>> ... 59 more
>>>
>>>
>>
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #636444 is a reply to message #636440] |
Mon, 01 November 2010 10:52 |
Daniel Messages: 16 Registered: June 2010 |
Junior Member |
|
|
Teneo Version: 1.1.2.v201009161849
The debugger doesn't stop at HbDataStore.initializeDataStore.
Daniel
Am 01.11.2010 11:16, schrieb Martin Taal:
> Hi Daniel,
> Hmm, it remains a strange thing as the setTuplizer is called from
> initialize. Can you set the breakpoint a bit earlier in the process in
> the HbDataStore.initializeDataStore method?
>
> Which version of Teneo are you using?
>
> gr. Martin
>
> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>> Hello Martin,
>>
>> I have the same problem and tried to debug into the setTuplizer method.
>>
>> I.e. I
>> - started jboss 5.1
>> - started remote eclipse debugging session
>> - set a breakpoint at HbDataStore.setTuplizer()
>> - redeployed my package into default/deploy
>>
>> As my eclipse doesn't start to blink and I don't see the debugger
>> activated the breakpoint I assume the HbDataStore.setTuplizer is not
>> called.
>>
>> Do you (or somebody else) have a solution please?
>>
>> Thank you
>> Daniel
>>
>>
>>
>>
>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>> Hi Ajay,
>>> It does not seem to use the EMFTuplizer but the standard
>>> PojoEntityTuplizer:
>>>
>>> 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)
>>>
>>>
>>>
>>>
>>> The tuplizer creates the accessors (setters/getters) used by Hibernate.
>>>
>>> Can you check/debug if the HbDataStore.setTuplizer() is called and what
>>> it does?
>>>
>>> gr. Martin
>>>
>>> Ajay Chauhan wrote:
>>>> Hello Martin,
>>>>
>>>> I am using two EMF classes and two DAOs (one for Employee and other
>>>> one for EmailAddresses) for performimg operations on EMF objects.
>>>>
>>>> Testcases for both Employee and EmailAddresses are working fine with
>>>> Teneo1.0.1 libraries but asking "setters" for EList type attributes
>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>
>>>> The generated interfaces are as follows:
>>>> 1.EmailAddresses
>>>> 2.Employee
>>>>
>>>> The generated implementation classes are as follows:
>>>> 1.EmailAddressesImpl
>>>> 2.EmployeeImpl
>>>>
>>>> Two DAOs:
>>>> 1. DAO_Employee
>>>> 2. DAO_EmailAddress
>>>>
>>>> The association between Employee and EmailAddresses is a bidirectional
>>>> one-to-many relationship.
>>>>
>>>> I am pasting complete Hbm file, Test class and Exception Log for your
>>>> perusal.
>>>>
>>>> Hbm for these two classes are listed below:
>>>> **************************************************
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <!-- Hibernate XML Mapping File -->
>>>> <!-- Author: U129098 -->
>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>> <hibernate-mapping auto-import="true">
>>>> <class
>>>> name="com.person.impl.EmployeeImpl"
>>>> table="employee" entity-name="Employee" mutable="true"
>>>> dynamic-update="false"
>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>> abstract="false">
>>>> <id name="personId" column="employee_id">
>>>> <generator class="increment" />
>>>> </id>
>>>> <property name="name" insert="true" update="true" lazy="false"
>>>> optimistic-lock="true" not-null="true">
>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>> </property>
>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>> fetch="select" cascade="all" inverse="true">
>>>> <key column="owner_id" />
>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>> entity-name="EmailAddresses" /> </bag>
>>>> </class>
>>>> <class
>>>> name="com.person.impl.EmailAddressesImpl"
>>>> table="email_address" entity-name="EmailAddresses" mutable="true"
>>>> dynamic-update="false"
>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>> abstract="false">
>>>> <id name="emailId" column="email_id">
>>>> <generator class="increment" />
>>>> </id>
>>>> <property name="emailAddress" insert="true" update="true"
>>>> lazy="false" optimistic-lock="true">
>>>> <column name="email_address" sql-type="varchar" not-null="true" />
>>>> </property>
>>>> <many-to-one name="owner" column="owner_id"
>>>> not-null="true"
>>>> class="com.person.impl.EmployeeImpl"
>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>> </class>
>>>> </hibernate-mapping>
>>>>
>>>> **************************************************
>>>>
>>>> TestClass for Employee class:
>>>>
>>>> ***************************************************
>>>>
>>>> public class EmployeeMappingTest {
>>>> protected static final String CONTEXT_FILE_NAME = "spring.xml";
>>>> protected static final ConfigurableApplicationContext springContext =
>>>> new ClassPathXmlApplicationContext(
>>>> CONTEXT_FILE_NAME);
>>>> DAO_Employee employeeDAO = null;
>>>> SessionFactory sessionFactory = null;
>>>>
>>>> /**
>>>> * SetUp method
>>>> */
>>>> @Before
>>>> public void setUp() throws Exception {
>>>> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
>>>> sessionFactory = (SessionFactory) springContext
>>>> .getBean("sessionFactory");
>>>> }
>>>>
>>>> @After
>>>> public void tearDown() throws Exception {
>>>> employeeDAO = null;
>>>> sessionFactory = null;
>>>> }
>>>>
>>>> /**
>>>> * Test method for saving an Employee object
>>>> */
>>>> @Test
>>>> public void testSaveEmployee() {
>>>>
>>>> Employee employee = new EmployeeImpl();
>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>> emailAddress.setOwner(employee);
>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>> emailAddress1.setOwner(employee);
>>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>>> eList.add(emailAddress);
>>>> eList.add(emailAddress1);
>>>>
>>>> employee.setName("Ajay Chauhan");
>>>> employee.getEmailAddresses().addAll(eList);
>>>>
>>>> try {
>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>> .beginTransaction();
>>>> employeeDAO.save(employee);
>>>> tx.commit();
>>>> } catch (Exception e) {
>>>> e.printStackTrace();
>>>> } }
>>>>
>>>> /**
>>>> * Test method for Load
>>>> */
>>>> @Test
>>>> public void testLoadByIdID_Employee() {
>>>>
>>>> // set the existing id
>>>> Integer id = 1;
>>>>
>>>> Employee obj = null;
>>>>
>>>> try {
>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>> .beginTransaction();
>>>> obj = (Employee) sessionFactory.getCurrentSession().get("Employee",id,
>>>> LockMode.READ);
>>>>
>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>
>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>> for (EmailAddresses email : eList) {
>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>> System.out.println("Email Address :: "
>>>> + email.getEmailAddress());
>>>> }
>>>> txn.commit();
>>>>
>>>> } catch (Exception e) {
>>>> e.printStackTrace();
>>>> }
>>>> }
>>>>
>>>> }
>>>> *********************************************************
>>>>
>>>>
>>>> Exceptions are:
>>>>
>>>> **********************************************************
>>>>
>>>>
>>>> log4j:WARN No appenders could be found for logger
>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>> log4j:WARN Please initialize the log4j system properly.
>>>> 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
>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>
>>>>
>>>>
>>>> at
>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>
>>>>
>>>>
>>>> at
>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>
>>>>
>>>>
>>>> at
>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>
>>>>
>>>>
>>>> at
>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>
>>>>
>>>>
>>>> at
>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>> 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: org.springframework.beans.factory.BeanCreationException:
>>>> Error creating bean with name 'employeeDAO' defined in class path
>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>> 'employeeSessionFactory' while setting bean property 'sessionFactory';
>>>> nested exception is
>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>> creating bean with name 'employeeHbSessionDataStore' defined in class
>>>> path resource [spring.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.person.teneo.
>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>
>>>>
>>>> threw exception; nested exception is
>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
>>>>
>>>>
>>>> ... 16 more
>>>> Caused by: org.springframework.beans.factory.BeanCreationException:
>>>> Error creating bean with name 'employeeHbSessionDataStore' defined in
>>>> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>
>>>>
>>>> threw exception; nested exception is
>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>> 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)
>>>>
>>>>
>>>>
>>>> ... 34 more
>>>> Caused by:
>>>> org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
>>>> Factory method [public synchronized
>>>> org.eclipse.emf.teneo.hibernate.HbDataStore
>>>> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>
>>>>
>>>> threw exception; nested exception is
>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>> at
>>>> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>>>>
>>>>
>>>>
>>>> at
>>>> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>>>>
>>>>
>>>>
>>>> ... 58 more
>>>> Caused by: org.hibernate.PropertyNotFoundException: Could not find a
>>>> setter for property emailAddresses in class
>>>> com.person.impl.EmployeeImpl
>>>> 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.person.teneo.
>>>> EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
>>>>
>>>>
>>>>
>>>> at com.person.teneo.
>>>> EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
>>>>
>>>>
>>>>
>>>> at
>>>> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
>>>>
>>>>
>>>>
>>>> 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)
>>>>
>>>>
>>>>
>>>> ... 59 more
>>>>
>>>>
>>>
>>>
>>
>
>
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #636481 is a reply to message #636444] |
Mon, 01 November 2010 14:18 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Can you check if the debugger stops in your own code where dataStore.initialize is called?
gr. Martin
On 11/01/2010 11:52 AM, Daniel Winz wrote:
> Teneo Version: 1.1.2.v201009161849
>
> The debugger doesn't stop at HbDataStore.initializeDataStore.
>
>
> Daniel
>
>
> Am 01.11.2010 11:16, schrieb Martin Taal:
>> Hi Daniel,
>> Hmm, it remains a strange thing as the setTuplizer is called from
>> initialize. Can you set the breakpoint a bit earlier in the process in
>> the HbDataStore.initializeDataStore method?
>>
>> Which version of Teneo are you using?
>>
>> gr. Martin
>>
>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>> Hello Martin,
>>>
>>> I have the same problem and tried to debug into the setTuplizer method.
>>>
>>> I.e. I
>>> - started jboss 5.1
>>> - started remote eclipse debugging session
>>> - set a breakpoint at HbDataStore.setTuplizer()
>>> - redeployed my package into default/deploy
>>>
>>> As my eclipse doesn't start to blink and I don't see the debugger
>>> activated the breakpoint I assume the HbDataStore.setTuplizer is not
>>> called.
>>>
>>> Do you (or somebody else) have a solution please?
>>>
>>> Thank you
>>> Daniel
>>>
>>>
>>>
>>>
>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>> Hi Ajay,
>>>> It does not seem to use the EMFTuplizer but the standard
>>>> PojoEntityTuplizer:
>>>>
>>>> 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)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> The tuplizer creates the accessors (setters/getters) used by Hibernate.
>>>>
>>>> Can you check/debug if the HbDataStore.setTuplizer() is called and what
>>>> it does?
>>>>
>>>> gr. Martin
>>>>
>>>> Ajay Chauhan wrote:
>>>>> Hello Martin,
>>>>>
>>>>> I am using two EMF classes and two DAOs (one for Employee and other
>>>>> one for EmailAddresses) for performimg operations on EMF objects.
>>>>>
>>>>> Testcases for both Employee and EmailAddresses are working fine with
>>>>> Teneo1.0.1 libraries but asking "setters" for EList type attributes
>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>
>>>>> The generated interfaces are as follows:
>>>>> 1.EmailAddresses
>>>>> 2.Employee
>>>>>
>>>>> The generated implementation classes are as follows:
>>>>> 1.EmailAddressesImpl
>>>>> 2.EmployeeImpl
>>>>>
>>>>> Two DAOs:
>>>>> 1. DAO_Employee
>>>>> 2. DAO_EmailAddress
>>>>>
>>>>> The association between Employee and EmailAddresses is a bidirectional
>>>>> one-to-many relationship.
>>>>>
>>>>> I am pasting complete Hbm file, Test class and Exception Log for your
>>>>> perusal.
>>>>>
>>>>> Hbm for these two classes are listed below:
>>>>> **************************************************
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <!-- Hibernate XML Mapping File -->
>>>>> <!-- Author: U129098 -->
>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>> <hibernate-mapping auto-import="true">
>>>>> <class
>>>>> name="com.person.impl.EmployeeImpl"
>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>> dynamic-update="false"
>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>> abstract="false">
>>>>> <id name="personId" column="employee_id">
>>>>> <generator class="increment" />
>>>>> </id>
>>>>> <property name="name" insert="true" update="true" lazy="false"
>>>>> optimistic-lock="true" not-null="true">
>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>> </property>
>>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>>> fetch="select" cascade="all" inverse="true">
>>>>> <key column="owner_id" />
>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>> entity-name="EmailAddresses" /> </bag>
>>>>> </class>
>>>>> <class
>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>> table="email_address" entity-name="EmailAddresses" mutable="true"
>>>>> dynamic-update="false"
>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>> abstract="false">
>>>>> <id name="emailId" column="email_id">
>>>>> <generator class="increment" />
>>>>> </id>
>>>>> <property name="emailAddress" insert="true" update="true"
>>>>> lazy="false" optimistic-lock="true">
>>>>> <column name="email_address" sql-type="varchar" not-null="true" />
>>>>> </property>
>>>>> <many-to-one name="owner" column="owner_id"
>>>>> not-null="true"
>>>>> class="com.person.impl.EmployeeImpl"
>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>> </class>
>>>>> </hibernate-mapping>
>>>>>
>>>>> **************************************************
>>>>>
>>>>> TestClass for Employee class:
>>>>>
>>>>> ***************************************************
>>>>>
>>>>> public class EmployeeMappingTest {
>>>>> protected static final String CONTEXT_FILE_NAME = "spring.xml";
>>>>> protected static final ConfigurableApplicationContext springContext =
>>>>> new ClassPathXmlApplicationContext(
>>>>> CONTEXT_FILE_NAME);
>>>>> DAO_Employee employeeDAO = null;
>>>>> SessionFactory sessionFactory = null;
>>>>>
>>>>> /**
>>>>> * SetUp method
>>>>> */
>>>>> @Before
>>>>> public void setUp() throws Exception {
>>>>> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
>>>>> sessionFactory = (SessionFactory) springContext
>>>>> .getBean("sessionFactory");
>>>>> }
>>>>>
>>>>> @After
>>>>> public void tearDown() throws Exception {
>>>>> employeeDAO = null;
>>>>> sessionFactory = null;
>>>>> }
>>>>>
>>>>> /**
>>>>> * Test method for saving an Employee object
>>>>> */
>>>>> @Test
>>>>> public void testSaveEmployee() {
>>>>>
>>>>> Employee employee = new EmployeeImpl();
>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>> emailAddress.setOwner(employee);
>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>> emailAddress1.setOwner(employee);
>>>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>>>> eList.add(emailAddress);
>>>>> eList.add(emailAddress1);
>>>>>
>>>>> employee.setName("Ajay Chauhan");
>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>
>>>>> try {
>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>> .beginTransaction();
>>>>> employeeDAO.save(employee);
>>>>> tx.commit();
>>>>> } catch (Exception e) {
>>>>> e.printStackTrace();
>>>>> } }
>>>>>
>>>>> /**
>>>>> * Test method for Load
>>>>> */
>>>>> @Test
>>>>> public void testLoadByIdID_Employee() {
>>>>>
>>>>> // set the existing id
>>>>> Integer id = 1;
>>>>>
>>>>> Employee obj = null;
>>>>>
>>>>> try {
>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>> .beginTransaction();
>>>>> obj = (Employee) sessionFactory.getCurrentSession().get("Employee",id,
>>>>> LockMode.READ);
>>>>>
>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>
>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>> for (EmailAddresses email : eList) {
>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>> System.out.println("Email Address :: "
>>>>> + email.getEmailAddress());
>>>>> }
>>>>> txn.commit();
>>>>>
>>>>> } catch (Exception e) {
>>>>> e.printStackTrace();
>>>>> }
>>>>> }
>>>>>
>>>>> }
>>>>> *********************************************************
>>>>>
>>>>>
>>>>> Exceptions are:
>>>>>
>>>>> **********************************************************
>>>>>
>>>>>
>>>>> log4j:WARN No appenders could be found for logger
>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>> 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
>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> at
>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> at
>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> at
>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> at
>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> at
>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>
>>>>> 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: org.springframework.beans.factory.BeanCreationException:
>>>>> Error creating bean with name 'employeeDAO' defined in class path
>>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>>> 'employeeSessionFactory' while setting bean property 'sessionFactory';
>>>>> nested exception is
>>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>>> creating bean with name 'employeeHbSessionDataStore' defined in class
>>>>> path resource [spring.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.person.teneo.
>>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>>
>>>>>
>>>>>
>>>>> threw exception; nested exception is
>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
>>>>>
>>>>>
>>>>>
>>>>> ... 16 more
>>>>> Caused by: org.springframework.beans.factory.BeanCreationException:
>>>>> Error creating bean with name 'employeeHbSessionDataStore' defined in
>>>>> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>
>>>>>
>>>>>
>>>>> threw exception; nested exception is
>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>> 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)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ... 34 more
>>>>> Caused by:
>>>>> org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
>>>>> Factory method [public synchronized
>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore
>>>>> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>
>>>>>
>>>>>
>>>>> threw exception; nested exception is
>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>> at
>>>>> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> at
>>>>> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ... 58 more
>>>>> Caused by: org.hibernate.PropertyNotFoundException: Could not find a
>>>>> setter for property emailAddresses in class
>>>>> com.person.impl.EmployeeImpl
>>>>> 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.person.teneo.
>>>>> EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> at com.person.teneo.
>>>>> EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> at
>>>>> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 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)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ... 59 more
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #636515 is a reply to message #636481] |
Mon, 01 November 2010 15:48 |
Daniel Messages: 16 Registered: June 2010 |
Junior Member |
|
|
Hi Martin,
the debugger doesn't stop at the breakpoint at initializeDataStore().
Instead it runs into HbSessionDataStore.initialize().
Breakpoint at initializeDataStore()
***************************
protected void initializeDataStore() {
// buildmappings has to be done before setting the tuplizers because
// buildMappings will ensure that the element
// is set in the List properties.
BP: buildMappings();
setInterceptor();
***************************
My testcode:
***********
public static void main(String[] args) {
HbDataStore hbds =
(HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb ");
final Properties props = new Properties();
props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
props.setProperty(Environment.URL,
"jdbc:mysql://127.0.0.1:3306/timetracker");
props.setProperty(Environment.USER, "root");
props.setProperty(Environment.PASS, "root");
props.setProperty(Environment.DIALECT,
org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
props.setProperty(Environment.SHOW_SQL, "true");
props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_C ONTAINMENT,
"REFRESH,PERSIST,MERGE");
hbds.setProperties(props);
hbds.setEPackages(new EPackage[]{TimetrackerPackage.eINSTANCE});
hbds.initialize();
************
???
Am 01.11.2010 15:18, schrieb Martin Taal:
> Can you check if the debugger stops in your own code where
> dataStore.initialize is called?
>
> gr. Martin
>
> On 11/01/2010 11:52 AM, Daniel Winz wrote:
>> Teneo Version: 1.1.2.v201009161849
>>
>> The debugger doesn't stop at HbDataStore.initializeDataStore.
>>
>>
>> Daniel
>>
>>
>> Am 01.11.2010 11:16, schrieb Martin Taal:
>>> Hi Daniel,
>>> Hmm, it remains a strange thing as the setTuplizer is called from
>>> initialize. Can you set the breakpoint a bit earlier in the process in
>>> the HbDataStore.initializeDataStore method?
>>>
>>> Which version of Teneo are you using?
>>>
>>> gr. Martin
>>>
>>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>>> Hello Martin,
>>>>
>>>> I have the same problem and tried to debug into the setTuplizer method.
>>>>
>>>> I.e. I
>>>> - started jboss 5.1
>>>> - started remote eclipse debugging session
>>>> - set a breakpoint at HbDataStore.setTuplizer()
>>>> - redeployed my package into default/deploy
>>>>
>>>> As my eclipse doesn't start to blink and I don't see the debugger
>>>> activated the breakpoint I assume the HbDataStore.setTuplizer is not
>>>> called.
>>>>
>>>> Do you (or somebody else) have a solution please?
>>>>
>>>> Thank you
>>>> Daniel
>>>>
>>>>
>>>>
>>>>
>>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>>> Hi Ajay,
>>>>> It does not seem to use the EMFTuplizer but the standard
>>>>> PojoEntityTuplizer:
>>>>>
>>>>> 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)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> The tuplizer creates the accessors (setters/getters) used by
>>>>> Hibernate.
>>>>>
>>>>> Can you check/debug if the HbDataStore.setTuplizer() is called and
>>>>> what
>>>>> it does?
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Ajay Chauhan wrote:
>>>>>> Hello Martin,
>>>>>>
>>>>>> I am using two EMF classes and two DAOs (one for Employee and other
>>>>>> one for EmailAddresses) for performimg operations on EMF objects.
>>>>>>
>>>>>> Testcases for both Employee and EmailAddresses are working fine with
>>>>>> Teneo1.0.1 libraries but asking "setters" for EList type attributes
>>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>>
>>>>>> The generated interfaces are as follows:
>>>>>> 1.EmailAddresses
>>>>>> 2.Employee
>>>>>>
>>>>>> The generated implementation classes are as follows:
>>>>>> 1.EmailAddressesImpl
>>>>>> 2.EmployeeImpl
>>>>>>
>>>>>> Two DAOs:
>>>>>> 1. DAO_Employee
>>>>>> 2. DAO_EmailAddress
>>>>>>
>>>>>> The association between Employee and EmailAddresses is a
>>>>>> bidirectional
>>>>>> one-to-many relationship.
>>>>>>
>>>>>> I am pasting complete Hbm file, Test class and Exception Log for your
>>>>>> perusal.
>>>>>>
>>>>>> Hbm for these two classes are listed below:
>>>>>> **************************************************
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>> <!-- Hibernate XML Mapping File -->
>>>>>> <!-- Author: U129098 -->
>>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>>> <hibernate-mapping auto-import="true">
>>>>>> <class
>>>>>> name="com.person.impl.EmployeeImpl"
>>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>>> dynamic-update="false"
>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>> abstract="false">
>>>>>> <id name="personId" column="employee_id">
>>>>>> <generator class="increment" />
>>>>>> </id>
>>>>>> <property name="name" insert="true" update="true" lazy="false"
>>>>>> optimistic-lock="true" not-null="true">
>>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>>> </property>
>>>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>>>> fetch="select" cascade="all" inverse="true">
>>>>>> <key column="owner_id" />
>>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>>> entity-name="EmailAddresses" /> </bag>
>>>>>> </class>
>>>>>> <class
>>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>>> table="email_address" entity-name="EmailAddresses" mutable="true"
>>>>>> dynamic-update="false"
>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>> abstract="false">
>>>>>> <id name="emailId" column="email_id">
>>>>>> <generator class="increment" />
>>>>>> </id>
>>>>>> <property name="emailAddress" insert="true" update="true"
>>>>>> lazy="false" optimistic-lock="true">
>>>>>> <column name="email_address" sql-type="varchar" not-null="true" />
>>>>>> </property>
>>>>>> <many-to-one name="owner" column="owner_id"
>>>>>> not-null="true"
>>>>>> class="com.person.impl.EmployeeImpl"
>>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>>> </class>
>>>>>> </hibernate-mapping>
>>>>>>
>>>>>> **************************************************
>>>>>>
>>>>>> TestClass for Employee class:
>>>>>>
>>>>>> ***************************************************
>>>>>>
>>>>>> public class EmployeeMappingTest {
>>>>>> protected static final String CONTEXT_FILE_NAME = "spring.xml";
>>>>>> protected static final ConfigurableApplicationContext springContext =
>>>>>> new ClassPathXmlApplicationContext(
>>>>>> CONTEXT_FILE_NAME);
>>>>>> DAO_Employee employeeDAO = null;
>>>>>> SessionFactory sessionFactory = null;
>>>>>>
>>>>>> /**
>>>>>> * SetUp method
>>>>>> */
>>>>>> @Before
>>>>>> public void setUp() throws Exception {
>>>>>> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
>>>>>> sessionFactory = (SessionFactory) springContext
>>>>>> .getBean("sessionFactory");
>>>>>> }
>>>>>>
>>>>>> @After
>>>>>> public void tearDown() throws Exception {
>>>>>> employeeDAO = null;
>>>>>> sessionFactory = null;
>>>>>> }
>>>>>>
>>>>>> /**
>>>>>> * Test method for saving an Employee object
>>>>>> */
>>>>>> @Test
>>>>>> public void testSaveEmployee() {
>>>>>>
>>>>>> Employee employee = new EmployeeImpl();
>>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>>> emailAddress.setOwner(employee);
>>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>>> emailAddress1.setOwner(employee);
>>>>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>>>>> eList.add(emailAddress);
>>>>>> eList.add(emailAddress1);
>>>>>>
>>>>>> employee.setName("Ajay Chauhan");
>>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>>
>>>>>> try {
>>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>>> .beginTransaction();
>>>>>> employeeDAO.save(employee);
>>>>>> tx.commit();
>>>>>> } catch (Exception e) {
>>>>>> e.printStackTrace();
>>>>>> } }
>>>>>>
>>>>>> /**
>>>>>> * Test method for Load
>>>>>> */
>>>>>> @Test
>>>>>> public void testLoadByIdID_Employee() {
>>>>>>
>>>>>> // set the existing id
>>>>>> Integer id = 1;
>>>>>>
>>>>>> Employee obj = null;
>>>>>>
>>>>>> try {
>>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>>> .beginTransaction();
>>>>>> obj = (Employee)
>>>>>> sessionFactory.getCurrentSession().get("Employee",id,
>>>>>> LockMode.READ);
>>>>>>
>>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>>
>>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>>> for (EmailAddresses email : eList) {
>>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>>> System.out.println("Email Address :: "
>>>>>> + email.getEmailAddress());
>>>>>> }
>>>>>> txn.commit();
>>>>>>
>>>>>> } catch (Exception e) {
>>>>>> e.printStackTrace();
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> }
>>>>>> *********************************************************
>>>>>>
>>>>>>
>>>>>> Exceptions are:
>>>>>>
>>>>>> **********************************************************
>>>>>>
>>>>>>
>>>>>> log4j:WARN No appenders could be found for logger
>>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>> 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
>>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>>
>>>>>>
>>>>>> 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: org.springframework.beans.factory.BeanCreationException:
>>>>>> Error creating bean with name 'employeeDAO' defined in class path
>>>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>>>> 'employeeSessionFactory' while setting bean property
>>>>>> 'sessionFactory';
>>>>>> nested exception is
>>>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>>>> creating bean with name 'employeeHbSessionDataStore' defined in class
>>>>>> path resource [spring.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.person.teneo.
>>>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> threw exception; nested exception is
>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ... 16 more
>>>>>> Caused by: org.springframework.beans.factory.BeanCreationException:
>>>>>> Error creating bean with name 'employeeHbSessionDataStore' defined in
>>>>>> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> threw exception; nested exception is
>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>> 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)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ... 34 more
>>>>>> Caused by:
>>>>>> org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
>>>>>> Factory method [public synchronized
>>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore
>>>>>> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> threw exception; nested exception is
>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>> at
>>>>>> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ... 58 more
>>>>>> Caused by: org.hibernate.PropertyNotFoundException: Could not find a
>>>>>> setter for property emailAddresses in class
>>>>>> com.person.impl.EmployeeImpl
>>>>>> 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.person.teneo.
>>>>>> EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> at com.person.teneo.
>>>>>> EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> 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)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ... 59 more
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #636516 is a reply to message #636515] |
Mon, 01 November 2010 16:09 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Daniel,
Inside the HbSessionDataStore.initialize method there is the call to initializeDataStore, what happens if you debug to
that call and into it?
gr. Martin
On 11/01/2010 04:48 PM, Daniel Winz wrote:
> Hi Martin,
>
>
> the debugger doesn't stop at the breakpoint at initializeDataStore().
> Instead it runs into HbSessionDataStore.initialize().
>
>
> Breakpoint at initializeDataStore()
> ***************************
> protected void initializeDataStore() {
> // buildmappings has to be done before setting the tuplizers because
> // buildMappings will ensure that the element
> // is set in the List properties.
> BP: buildMappings();
>
> setInterceptor();
> ***************************
>
>
> My testcode:
> ***********
> public static void main(String[] args) {
>
> HbDataStore hbds =
> (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb ");
>
> final Properties props = new Properties();
> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
> props.setProperty(Environment.URL,
> "jdbc:mysql://127.0.0.1:3306/timetracker");
> props.setProperty(Environment.USER, "root");
> props.setProperty(Environment.PASS, "root");
> props.setProperty(Environment.DIALECT,
> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
> props.setProperty(Environment.SHOW_SQL, "true");
>
> props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_C ONTAINMENT,
> "REFRESH,PERSIST,MERGE");
>
> hbds.setProperties(props);
>
> hbds.setEPackages(new EPackage[]{TimetrackerPackage.eINSTANCE});
> hbds.initialize();
> ************
>
> ???
>
>
>
>
>
>
>
>
> Am 01.11.2010 15:18, schrieb Martin Taal:
>> Can you check if the debugger stops in your own code where
>> dataStore.initialize is called?
>>
>> gr. Martin
>>
>> On 11/01/2010 11:52 AM, Daniel Winz wrote:
>>> Teneo Version: 1.1.2.v201009161849
>>>
>>> The debugger doesn't stop at HbDataStore.initializeDataStore.
>>>
>>>
>>> Daniel
>>>
>>>
>>> Am 01.11.2010 11:16, schrieb Martin Taal:
>>>> Hi Daniel,
>>>> Hmm, it remains a strange thing as the setTuplizer is called from
>>>> initialize. Can you set the breakpoint a bit earlier in the process in
>>>> the HbDataStore.initializeDataStore method?
>>>>
>>>> Which version of Teneo are you using?
>>>>
>>>> gr. Martin
>>>>
>>>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>>>> Hello Martin,
>>>>>
>>>>> I have the same problem and tried to debug into the setTuplizer
>>>>> method.
>>>>>
>>>>> I.e. I
>>>>> - started jboss 5.1
>>>>> - started remote eclipse debugging session
>>>>> - set a breakpoint at HbDataStore.setTuplizer()
>>>>> - redeployed my package into default/deploy
>>>>>
>>>>> As my eclipse doesn't start to blink and I don't see the debugger
>>>>> activated the breakpoint I assume the HbDataStore.setTuplizer is not
>>>>> called.
>>>>>
>>>>> Do you (or somebody else) have a solution please?
>>>>>
>>>>> Thank you
>>>>> Daniel
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>>>> Hi Ajay,
>>>>>> It does not seem to use the EMFTuplizer but the standard
>>>>>> PojoEntityTuplizer:
>>>>>>
>>>>>> 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)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> The tuplizer creates the accessors (setters/getters) used by
>>>>>> Hibernate.
>>>>>>
>>>>>> Can you check/debug if the HbDataStore.setTuplizer() is called and
>>>>>> what
>>>>>> it does?
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> Ajay Chauhan wrote:
>>>>>>> Hello Martin,
>>>>>>>
>>>>>>> I am using two EMF classes and two DAOs (one for Employee and other
>>>>>>> one for EmailAddresses) for performimg operations on EMF objects.
>>>>>>>
>>>>>>> Testcases for both Employee and EmailAddresses are working fine with
>>>>>>> Teneo1.0.1 libraries but asking "setters" for EList type attributes
>>>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>>>
>>>>>>> The generated interfaces are as follows:
>>>>>>> 1.EmailAddresses
>>>>>>> 2.Employee
>>>>>>>
>>>>>>> The generated implementation classes are as follows:
>>>>>>> 1.EmailAddressesImpl
>>>>>>> 2.EmployeeImpl
>>>>>>>
>>>>>>> Two DAOs:
>>>>>>> 1. DAO_Employee
>>>>>>> 2. DAO_EmailAddress
>>>>>>>
>>>>>>> The association between Employee and EmailAddresses is a
>>>>>>> bidirectional
>>>>>>> one-to-many relationship.
>>>>>>>
>>>>>>> I am pasting complete Hbm file, Test class and Exception Log for
>>>>>>> your
>>>>>>> perusal.
>>>>>>>
>>>>>>> Hbm for these two classes are listed below:
>>>>>>> **************************************************
>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>> <!-- Hibernate XML Mapping File -->
>>>>>>> <!-- Author: U129098 -->
>>>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>>>> <hibernate-mapping auto-import="true">
>>>>>>> <class
>>>>>>> name="com.person.impl.EmployeeImpl"
>>>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>>>> dynamic-update="false"
>>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>>> abstract="false">
>>>>>>> <id name="personId" column="employee_id">
>>>>>>> <generator class="increment" />
>>>>>>> </id>
>>>>>>> <property name="name" insert="true" update="true" lazy="false"
>>>>>>> optimistic-lock="true" not-null="true">
>>>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>>>> </property>
>>>>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>>>>> fetch="select" cascade="all" inverse="true">
>>>>>>> <key column="owner_id" />
>>>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>>>> entity-name="EmailAddresses" /> </bag>
>>>>>>> </class>
>>>>>>> <class
>>>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>>>> table="email_address" entity-name="EmailAddresses" mutable="true"
>>>>>>> dynamic-update="false"
>>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>>> abstract="false">
>>>>>>> <id name="emailId" column="email_id">
>>>>>>> <generator class="increment" />
>>>>>>> </id>
>>>>>>> <property name="emailAddress" insert="true" update="true"
>>>>>>> lazy="false" optimistic-lock="true">
>>>>>>> <column name="email_address" sql-type="varchar" not-null="true" />
>>>>>>> </property>
>>>>>>> <many-to-one name="owner" column="owner_id"
>>>>>>> not-null="true"
>>>>>>> class="com.person.impl.EmployeeImpl"
>>>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>>>> </class>
>>>>>>> </hibernate-mapping>
>>>>>>>
>>>>>>> **************************************************
>>>>>>>
>>>>>>> TestClass for Employee class:
>>>>>>>
>>>>>>> ***************************************************
>>>>>>>
>>>>>>> public class EmployeeMappingTest {
>>>>>>> protected static final String CONTEXT_FILE_NAME = "spring.xml";
>>>>>>> protected static final ConfigurableApplicationContext
>>>>>>> springContext =
>>>>>>> new ClassPathXmlApplicationContext(
>>>>>>> CONTEXT_FILE_NAME);
>>>>>>> DAO_Employee employeeDAO = null;
>>>>>>> SessionFactory sessionFactory = null;
>>>>>>>
>>>>>>> /**
>>>>>>> * SetUp method
>>>>>>> */
>>>>>>> @Before
>>>>>>> public void setUp() throws Exception {
>>>>>>> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
>>>>>>> sessionFactory = (SessionFactory) springContext
>>>>>>> .getBean("sessionFactory");
>>>>>>> }
>>>>>>>
>>>>>>> @After
>>>>>>> public void tearDown() throws Exception {
>>>>>>> employeeDAO = null;
>>>>>>> sessionFactory = null;
>>>>>>> }
>>>>>>>
>>>>>>> /**
>>>>>>> * Test method for saving an Employee object
>>>>>>> */
>>>>>>> @Test
>>>>>>> public void testSaveEmployee() {
>>>>>>>
>>>>>>> Employee employee = new EmployeeImpl();
>>>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>>>> emailAddress.setOwner(employee);
>>>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>>>> emailAddress1.setOwner(employee);
>>>>>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>>>>>> eList.add(emailAddress);
>>>>>>> eList.add(emailAddress1);
>>>>>>>
>>>>>>> employee.setName("Ajay Chauhan");
>>>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>>>
>>>>>>> try {
>>>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>>>> .beginTransaction();
>>>>>>> employeeDAO.save(employee);
>>>>>>> tx.commit();
>>>>>>> } catch (Exception e) {
>>>>>>> e.printStackTrace();
>>>>>>> } }
>>>>>>>
>>>>>>> /**
>>>>>>> * Test method for Load
>>>>>>> */
>>>>>>> @Test
>>>>>>> public void testLoadByIdID_Employee() {
>>>>>>>
>>>>>>> // set the existing id
>>>>>>> Integer id = 1;
>>>>>>>
>>>>>>> Employee obj = null;
>>>>>>>
>>>>>>> try {
>>>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>>>> .beginTransaction();
>>>>>>> obj = (Employee)
>>>>>>> sessionFactory.getCurrentSession().get("Employee",id,
>>>>>>> LockMode.READ);
>>>>>>>
>>>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>>>
>>>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>>>> for (EmailAddresses email : eList) {
>>>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>>>> System.out.println("Email Address :: "
>>>>>>> + email.getEmailAddress());
>>>>>>> }
>>>>>>> txn.commit();
>>>>>>>
>>>>>>> } catch (Exception e) {
>>>>>>> e.printStackTrace();
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> }
>>>>>>> *********************************************************
>>>>>>>
>>>>>>>
>>>>>>> Exceptions are:
>>>>>>>
>>>>>>> **********************************************************
>>>>>>>
>>>>>>>
>>>>>>> log4j:WARN No appenders could be found for logger
>>>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>>>>
>>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>>> 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
>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 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: org.springframework.beans.factory.BeanCreationException:
>>>>>>> Error creating bean with name 'employeeDAO' defined in class path
>>>>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>>>>> 'employeeSessionFactory' while setting bean property
>>>>>>> 'sessionFactory';
>>>>>>> nested exception is
>>>>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>>>>> creating bean with name 'employeeHbSessionDataStore' defined in
>>>>>>> class
>>>>>>> path resource [spring.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.person.teneo.
>>>>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> threw exception; nested exception is
>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ... 16 more
>>>>>>> Caused by: org.springframework.beans.factory.BeanCreationException:
>>>>>>> Error creating bean with name 'employeeHbSessionDataStore'
>>>>>>> defined in
>>>>>>> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> threw exception; nested exception is
>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>> 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)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ... 34 more
>>>>>>> Caused by:
>>>>>>> org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
>>>>>>> Factory method [public synchronized
>>>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore
>>>>>>> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> threw exception; nested exception is
>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>> at
>>>>>>> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ... 58 more
>>>>>>> Caused by: org.hibernate.PropertyNotFoundException: Could not find a
>>>>>>> setter for property emailAddresses in class
>>>>>>> com.person.impl.EmployeeImpl
>>>>>>> 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.person.teneo.
>>>>>>> EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at com.person.teneo.
>>>>>>> EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 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)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ... 59 more
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #636533 is a reply to message #636516] |
Mon, 01 November 2010 17:50 |
Daniel Messages: 16 Registered: June 2010 |
Junior Member |
|
|
The debugger gets off before at getConfiguration() and jumps into the
finally sequence. hbConfiguration = null.
I tried to place the service-hibernate.xml that contains
hibernate-configuration at src and src/META-INF. But same result.
Daniel
Am 01.11.2010 17:09, schrieb Martin Taal:
> Hi Daniel,
> Inside the HbSessionDataStore.initialize method there is the call to
> initializeDataStore, what happens if you debug to that call and into it?
>
> gr. Martin
>
> On 11/01/2010 04:48 PM, Daniel Winz wrote:
>
>
>> Hi Martin,
>>
>>
>> the debugger doesn't stop at the breakpoint at initializeDataStore().
>> Instead it runs into HbSessionDataStore.initialize().
>>
>>
>> Breakpoint at initializeDataStore()
>> ***************************
>> protected void initializeDataStore() {
>> // buildmappings has to be done before setting the tuplizers because
>> // buildMappings will ensure that the element
>> // is set in the List properties.
>> BP: buildMappings();
>>
>> setInterceptor();
>> ***************************
>>
>>
>> My testcode:
>> ***********
>> public static void main(String[] args) {
>>
>> HbDataStore hbds =
>> (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb ");
>>
>> final Properties props = new Properties();
>> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
>> props.setProperty(Environment.URL,
>> "jdbc:mysql://127.0.0.1:3306/timetracker");
>> props.setProperty(Environment.USER, "root");
>> props.setProperty(Environment.PASS, "root");
>> props.setProperty(Environment.DIALECT,
>> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
>> props.setProperty(Environment.SHOW_SQL, "true");
>>
>> props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_C ONTAINMENT,
>> "REFRESH,PERSIST,MERGE");
>>
>> hbds.setProperties(props);
>>
>> hbds.setEPackages(new EPackage[]{TimetrackerPackage.eINSTANCE});
>> hbds.initialize();
>> ************
>>
>> ???
>>
>>
>>
>>
>>
>>
>>
>>
>> Am 01.11.2010 15:18, schrieb Martin Taal:
>>> Can you check if the debugger stops in your own code where
>>> dataStore.initialize is called?
>>>
>>> gr. Martin
>>>
>>> On 11/01/2010 11:52 AM, Daniel Winz wrote:
>>>> Teneo Version: 1.1.2.v201009161849
>>>>
>>>> The debugger doesn't stop at HbDataStore.initializeDataStore.
>>>>
>>>>
>>>> Daniel
>>>>
>>>>
>>>> Am 01.11.2010 11:16, schrieb Martin Taal:
>>>>> Hi Daniel,
>>>>> Hmm, it remains a strange thing as the setTuplizer is called from
>>>>> initialize. Can you set the breakpoint a bit earlier in the process in
>>>>> the HbDataStore.initializeDataStore method?
>>>>>
>>>>> Which version of Teneo are you using?
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>>>>> Hello Martin,
>>>>>>
>>>>>> I have the same problem and tried to debug into the setTuplizer
>>>>>> method.
>>>>>>
>>>>>> I.e. I
>>>>>> - started jboss 5.1
>>>>>> - started remote eclipse debugging session
>>>>>> - set a breakpoint at HbDataStore.setTuplizer()
>>>>>> - redeployed my package into default/deploy
>>>>>>
>>>>>> As my eclipse doesn't start to blink and I don't see the debugger
>>>>>> activated the breakpoint I assume the HbDataStore.setTuplizer is not
>>>>>> called.
>>>>>>
>>>>>> Do you (or somebody else) have a solution please?
>>>>>>
>>>>>> Thank you
>>>>>> Daniel
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>>>>> Hi Ajay,
>>>>>>> It does not seem to use the EMFTuplizer but the standard
>>>>>>> PojoEntityTuplizer:
>>>>>>>
>>>>>>> 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)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> The tuplizer creates the accessors (setters/getters) used by
>>>>>>> Hibernate.
>>>>>>>
>>>>>>> Can you check/debug if the HbDataStore.setTuplizer() is called and
>>>>>>> what
>>>>>>> it does?
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> Ajay Chauhan wrote:
>>>>>>>> Hello Martin,
>>>>>>>>
>>>>>>>> I am using two EMF classes and two DAOs (one for Employee and other
>>>>>>>> one for EmailAddresses) for performimg operations on EMF objects.
>>>>>>>>
>>>>>>>> Testcases for both Employee and EmailAddresses are working fine
>>>>>>>> with
>>>>>>>> Teneo1.0.1 libraries but asking "setters" for EList type attributes
>>>>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>>>>
>>>>>>>> The generated interfaces are as follows:
>>>>>>>> 1.EmailAddresses
>>>>>>>> 2.Employee
>>>>>>>>
>>>>>>>> The generated implementation classes are as follows:
>>>>>>>> 1.EmailAddressesImpl
>>>>>>>> 2.EmployeeImpl
>>>>>>>>
>>>>>>>> Two DAOs:
>>>>>>>> 1. DAO_Employee
>>>>>>>> 2. DAO_EmailAddress
>>>>>>>>
>>>>>>>> The association between Employee and EmailAddresses is a
>>>>>>>> bidirectional
>>>>>>>> one-to-many relationship.
>>>>>>>>
>>>>>>>> I am pasting complete Hbm file, Test class and Exception Log for
>>>>>>>> your
>>>>>>>> perusal.
>>>>>>>>
>>>>>>>> Hbm for these two classes are listed below:
>>>>>>>> **************************************************
>>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>>> <!-- Hibernate XML Mapping File -->
>>>>>>>> <!-- Author: U129098 -->
>>>>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>>>>> <hibernate-mapping auto-import="true">
>>>>>>>> <class
>>>>>>>> name="com.person.impl.EmployeeImpl"
>>>>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>>>>> dynamic-update="false"
>>>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>>>> abstract="false">
>>>>>>>> <id name="personId" column="employee_id">
>>>>>>>> <generator class="increment" />
>>>>>>>> </id>
>>>>>>>> <property name="name" insert="true" update="true" lazy="false"
>>>>>>>> optimistic-lock="true" not-null="true">
>>>>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>>>>> </property>
>>>>>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>>>>>> fetch="select" cascade="all" inverse="true">
>>>>>>>> <key column="owner_id" />
>>>>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>>>>> entity-name="EmailAddresses" /> </bag>
>>>>>>>> </class>
>>>>>>>> <class
>>>>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>>>>> table="email_address" entity-name="EmailAddresses" mutable="true"
>>>>>>>> dynamic-update="false"
>>>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>>>> abstract="false">
>>>>>>>> <id name="emailId" column="email_id">
>>>>>>>> <generator class="increment" />
>>>>>>>> </id>
>>>>>>>> <property name="emailAddress" insert="true" update="true"
>>>>>>>> lazy="false" optimistic-lock="true">
>>>>>>>> <column name="email_address" sql-type="varchar" not-null="true" />
>>>>>>>> </property>
>>>>>>>> <many-to-one name="owner" column="owner_id"
>>>>>>>> not-null="true"
>>>>>>>> class="com.person.impl.EmployeeImpl"
>>>>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>>>>> </class>
>>>>>>>> </hibernate-mapping>
>>>>>>>>
>>>>>>>> **************************************************
>>>>>>>>
>>>>>>>> TestClass for Employee class:
>>>>>>>>
>>>>>>>> ***************************************************
>>>>>>>>
>>>>>>>> public class EmployeeMappingTest {
>>>>>>>> protected static final String CONTEXT_FILE_NAME = "spring.xml";
>>>>>>>> protected static final ConfigurableApplicationContext
>>>>>>>> springContext =
>>>>>>>> new ClassPathXmlApplicationContext(
>>>>>>>> CONTEXT_FILE_NAME);
>>>>>>>> DAO_Employee employeeDAO = null;
>>>>>>>> SessionFactory sessionFactory = null;
>>>>>>>>
>>>>>>>> /**
>>>>>>>> * SetUp method
>>>>>>>> */
>>>>>>>> @Before
>>>>>>>> public void setUp() throws Exception {
>>>>>>>> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
>>>>>>>> sessionFactory = (SessionFactory) springContext
>>>>>>>> .getBean("sessionFactory");
>>>>>>>> }
>>>>>>>>
>>>>>>>> @After
>>>>>>>> public void tearDown() throws Exception {
>>>>>>>> employeeDAO = null;
>>>>>>>> sessionFactory = null;
>>>>>>>> }
>>>>>>>>
>>>>>>>> /**
>>>>>>>> * Test method for saving an Employee object
>>>>>>>> */
>>>>>>>> @Test
>>>>>>>> public void testSaveEmployee() {
>>>>>>>>
>>>>>>>> Employee employee = new EmployeeImpl();
>>>>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>>>>> emailAddress.setOwner(employee);
>>>>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>>>>> emailAddress1.setOwner(employee);
>>>>>>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>>>>>>> eList.add(emailAddress);
>>>>>>>> eList.add(emailAddress1);
>>>>>>>>
>>>>>>>> employee.setName("Ajay Chauhan");
>>>>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>>>>
>>>>>>>> try {
>>>>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>>>>> .beginTransaction();
>>>>>>>> employeeDAO.save(employee);
>>>>>>>> tx.commit();
>>>>>>>> } catch (Exception e) {
>>>>>>>> e.printStackTrace();
>>>>>>>> } }
>>>>>>>>
>>>>>>>> /**
>>>>>>>> * Test method for Load
>>>>>>>> */
>>>>>>>> @Test
>>>>>>>> public void testLoadByIdID_Employee() {
>>>>>>>>
>>>>>>>> // set the existing id
>>>>>>>> Integer id = 1;
>>>>>>>>
>>>>>>>> Employee obj = null;
>>>>>>>>
>>>>>>>> try {
>>>>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>>>>> .beginTransaction();
>>>>>>>> obj = (Employee)
>>>>>>>> sessionFactory.getCurrentSession().get("Employee",id,
>>>>>>>> LockMode.READ);
>>>>>>>>
>>>>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>>>>
>>>>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>>>>> for (EmailAddresses email : eList) {
>>>>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>>>>> System.out.println("Email Address :: "
>>>>>>>> + email.getEmailAddress());
>>>>>>>> }
>>>>>>>> txn.commit();
>>>>>>>>
>>>>>>>> } catch (Exception e) {
>>>>>>>> e.printStackTrace();
>>>>>>>> }
>>>>>>>> }
>>>>>>>>
>>>>>>>> }
>>>>>>>> *********************************************************
>>>>>>>>
>>>>>>>>
>>>>>>>> Exceptions are:
>>>>>>>>
>>>>>>>> **********************************************************
>>>>>>>>
>>>>>>>>
>>>>>>>> log4j:WARN No appenders could be found for logger
>>>>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>>>>>
>>>>>>>>
>>>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>>>> 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
>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 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: org.springframework.beans.factory.BeanCreationException:
>>>>>>>> Error creating bean with name 'employeeDAO' defined in class path
>>>>>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>>>>>> 'employeeSessionFactory' while setting bean property
>>>>>>>> 'sessionFactory';
>>>>>>>> nested exception is
>>>>>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>>>>>> creating bean with name 'employeeHbSessionDataStore' defined in
>>>>>>>> class
>>>>>>>> path resource [spring.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.person.teneo.
>>>>>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> threw exception; nested exception is
>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter
>>>>>>>> for
>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ... 16 more
>>>>>>>> Caused by: org.springframework.beans.factory.BeanCreationException:
>>>>>>>> Error creating bean with name 'employeeHbSessionDataStore'
>>>>>>>> defined in
>>>>>>>> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> threw exception; nested exception is
>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter
>>>>>>>> for
>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>> 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)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ... 34 more
>>>>>>>> Caused by:
>>>>>>>> org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
>>>>>>>> Factory method [public synchronized
>>>>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore
>>>>>>>> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> threw exception; nested exception is
>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter
>>>>>>>> for
>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>> at
>>>>>>>> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ... 58 more
>>>>>>>> Caused by: org.hibernate.PropertyNotFoundException: Could not
>>>>>>>> find a
>>>>>>>> setter for property emailAddresses in class
>>>>>>>> com.person.impl.EmployeeImpl
>>>>>>>> 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.person.teneo.
>>>>>>>> EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at com.person.teneo.
>>>>>>>> EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 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)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ... 59 more
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #636541 is a reply to message #636533] |
Mon, 01 November 2010 19:41 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
hmm, it sounds like that an exception occured, are you catching an exception somewhere maybe?
For the rest I am kind of puzzled why debugging does not work as expected...
gr. Martin
On 11/01/2010 06:50 PM, Daniel Winz wrote:
> The debugger gets off before at getConfiguration() and jumps into the
> finally sequence. hbConfiguration = null.
>
> I tried to place the service-hibernate.xml that contains
> hibernate-configuration at src and src/META-INF. But same result.
>
>
>
> Daniel
>
>
>
> Am 01.11.2010 17:09, schrieb Martin Taal:
>> Hi Daniel,
>> Inside the HbSessionDataStore.initialize method there is the call to
>> initializeDataStore, what happens if you debug to that call and into it?
>>
>> gr. Martin
>>
>> On 11/01/2010 04:48 PM, Daniel Winz wrote:
>>
>>
>>> Hi Martin,
>>>
>>>
>>> the debugger doesn't stop at the breakpoint at initializeDataStore().
>>> Instead it runs into HbSessionDataStore.initialize().
>>>
>>>
>>> Breakpoint at initializeDataStore()
>>> ***************************
>>> protected void initializeDataStore() {
>>> // buildmappings has to be done before setting the tuplizers because
>>> // buildMappings will ensure that the element
>>> // is set in the List properties.
>>> BP: buildMappings();
>>>
>>> setInterceptor();
>>> ***************************
>>>
>>>
>>> My testcode:
>>> ***********
>>> public static void main(String[] args) {
>>>
>>> HbDataStore hbds =
>>> (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb ");
>>>
>>> final Properties props = new Properties();
>>> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
>>> props.setProperty(Environment.URL,
>>> "jdbc:mysql://127.0.0.1:3306/timetracker");
>>> props.setProperty(Environment.USER, "root");
>>> props.setProperty(Environment.PASS, "root");
>>> props.setProperty(Environment.DIALECT,
>>> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
>>> props.setProperty(Environment.SHOW_SQL, "true");
>>>
>>> props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_C ONTAINMENT,
>>> "REFRESH,PERSIST,MERGE");
>>>
>>> hbds.setProperties(props);
>>>
>>> hbds.setEPackages(new EPackage[]{TimetrackerPackage.eINSTANCE});
>>> hbds.initialize();
>>> ************
>>>
>>> ???
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Am 01.11.2010 15:18, schrieb Martin Taal:
>>>> Can you check if the debugger stops in your own code where
>>>> dataStore.initialize is called?
>>>>
>>>> gr. Martin
>>>>
>>>> On 11/01/2010 11:52 AM, Daniel Winz wrote:
>>>>> Teneo Version: 1.1.2.v201009161849
>>>>>
>>>>> The debugger doesn't stop at HbDataStore.initializeDataStore.
>>>>>
>>>>>
>>>>> Daniel
>>>>>
>>>>>
>>>>> Am 01.11.2010 11:16, schrieb Martin Taal:
>>>>>> Hi Daniel,
>>>>>> Hmm, it remains a strange thing as the setTuplizer is called from
>>>>>> initialize. Can you set the breakpoint a bit earlier in the
>>>>>> process in
>>>>>> the HbDataStore.initializeDataStore method?
>>>>>>
>>>>>> Which version of Teneo are you using?
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>>>>>> Hello Martin,
>>>>>>>
>>>>>>> I have the same problem and tried to debug into the setTuplizer
>>>>>>> method.
>>>>>>>
>>>>>>> I.e. I
>>>>>>> - started jboss 5.1
>>>>>>> - started remote eclipse debugging session
>>>>>>> - set a breakpoint at HbDataStore.setTuplizer()
>>>>>>> - redeployed my package into default/deploy
>>>>>>>
>>>>>>> As my eclipse doesn't start to blink and I don't see the debugger
>>>>>>> activated the breakpoint I assume the HbDataStore.setTuplizer is not
>>>>>>> called.
>>>>>>>
>>>>>>> Do you (or somebody else) have a solution please?
>>>>>>>
>>>>>>> Thank you
>>>>>>> Daniel
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>>>>>> Hi Ajay,
>>>>>>>> It does not seem to use the EMFTuplizer but the standard
>>>>>>>> PojoEntityTuplizer:
>>>>>>>>
>>>>>>>> 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)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> The tuplizer creates the accessors (setters/getters) used by
>>>>>>>> Hibernate.
>>>>>>>>
>>>>>>>> Can you check/debug if the HbDataStore.setTuplizer() is called and
>>>>>>>> what
>>>>>>>> it does?
>>>>>>>>
>>>>>>>> gr. Martin
>>>>>>>>
>>>>>>>> Ajay Chauhan wrote:
>>>>>>>>> Hello Martin,
>>>>>>>>>
>>>>>>>>> I am using two EMF classes and two DAOs (one for Employee and
>>>>>>>>> other
>>>>>>>>> one for EmailAddresses) for performimg operations on EMF objects.
>>>>>>>>>
>>>>>>>>> Testcases for both Employee and EmailAddresses are working fine
>>>>>>>>> with
>>>>>>>>> Teneo1.0.1 libraries but asking "setters" for EList type
>>>>>>>>> attributes
>>>>>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>>>>>
>>>>>>>>> The generated interfaces are as follows:
>>>>>>>>> 1.EmailAddresses
>>>>>>>>> 2.Employee
>>>>>>>>>
>>>>>>>>> The generated implementation classes are as follows:
>>>>>>>>> 1.EmailAddressesImpl
>>>>>>>>> 2.EmployeeImpl
>>>>>>>>>
>>>>>>>>> Two DAOs:
>>>>>>>>> 1. DAO_Employee
>>>>>>>>> 2. DAO_EmailAddress
>>>>>>>>>
>>>>>>>>> The association between Employee and EmailAddresses is a
>>>>>>>>> bidirectional
>>>>>>>>> one-to-many relationship.
>>>>>>>>>
>>>>>>>>> I am pasting complete Hbm file, Test class and Exception Log for
>>>>>>>>> your
>>>>>>>>> perusal.
>>>>>>>>>
>>>>>>>>> Hbm for these two classes are listed below:
>>>>>>>>> **************************************************
>>>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>>>> <!-- Hibernate XML Mapping File -->
>>>>>>>>> <!-- Author: U129098 -->
>>>>>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>>>>>> <hibernate-mapping auto-import="true">
>>>>>>>>> <class
>>>>>>>>> name="com.person.impl.EmployeeImpl"
>>>>>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>>>>>> dynamic-update="false"
>>>>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>>>>> abstract="false">
>>>>>>>>> <id name="personId" column="employee_id">
>>>>>>>>> <generator class="increment" />
>>>>>>>>> </id>
>>>>>>>>> <property name="name" insert="true" update="true" lazy="false"
>>>>>>>>> optimistic-lock="true" not-null="true">
>>>>>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>>>>>> </property>
>>>>>>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>>>>>>> fetch="select" cascade="all" inverse="true">
>>>>>>>>> <key column="owner_id" />
>>>>>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>>>>>> entity-name="EmailAddresses" /> </bag>
>>>>>>>>> </class>
>>>>>>>>> <class
>>>>>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>>>>>> table="email_address" entity-name="EmailAddresses" mutable="true"
>>>>>>>>> dynamic-update="false"
>>>>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>>>>> abstract="false">
>>>>>>>>> <id name="emailId" column="email_id">
>>>>>>>>> <generator class="increment" />
>>>>>>>>> </id>
>>>>>>>>> <property name="emailAddress" insert="true" update="true"
>>>>>>>>> lazy="false" optimistic-lock="true">
>>>>>>>>> <column name="email_address" sql-type="varchar" not-null="true" />
>>>>>>>>> </property>
>>>>>>>>> <many-to-one name="owner" column="owner_id"
>>>>>>>>> not-null="true"
>>>>>>>>> class="com.person.impl.EmployeeImpl"
>>>>>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>>>>>> </class>
>>>>>>>>> </hibernate-mapping>
>>>>>>>>>
>>>>>>>>> **************************************************
>>>>>>>>>
>>>>>>>>> TestClass for Employee class:
>>>>>>>>>
>>>>>>>>> ***************************************************
>>>>>>>>>
>>>>>>>>> public class EmployeeMappingTest {
>>>>>>>>> protected static final String CONTEXT_FILE_NAME = "spring.xml";
>>>>>>>>> protected static final ConfigurableApplicationContext
>>>>>>>>> springContext =
>>>>>>>>> new ClassPathXmlApplicationContext(
>>>>>>>>> CONTEXT_FILE_NAME);
>>>>>>>>> DAO_Employee employeeDAO = null;
>>>>>>>>> SessionFactory sessionFactory = null;
>>>>>>>>>
>>>>>>>>> /**
>>>>>>>>> * SetUp method
>>>>>>>>> */
>>>>>>>>> @Before
>>>>>>>>> public void setUp() throws Exception {
>>>>>>>>> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
>>>>>>>>> sessionFactory = (SessionFactory) springContext
>>>>>>>>> .getBean("sessionFactory");
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> @After
>>>>>>>>> public void tearDown() throws Exception {
>>>>>>>>> employeeDAO = null;
>>>>>>>>> sessionFactory = null;
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> /**
>>>>>>>>> * Test method for saving an Employee object
>>>>>>>>> */
>>>>>>>>> @Test
>>>>>>>>> public void testSaveEmployee() {
>>>>>>>>>
>>>>>>>>> Employee employee = new EmployeeImpl();
>>>>>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>>>>>> emailAddress.setOwner(employee);
>>>>>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>>>>>> emailAddress1.setOwner(employee);
>>>>>>>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>>>>>>>> eList.add(emailAddress);
>>>>>>>>> eList.add(emailAddress1);
>>>>>>>>>
>>>>>>>>> employee.setName("Ajay Chauhan");
>>>>>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>>>>>
>>>>>>>>> try {
>>>>>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>>>>>> .beginTransaction();
>>>>>>>>> employeeDAO.save(employee);
>>>>>>>>> tx.commit();
>>>>>>>>> } catch (Exception e) {
>>>>>>>>> e.printStackTrace();
>>>>>>>>> } }
>>>>>>>>>
>>>>>>>>> /**
>>>>>>>>> * Test method for Load
>>>>>>>>> */
>>>>>>>>> @Test
>>>>>>>>> public void testLoadByIdID_Employee() {
>>>>>>>>>
>>>>>>>>> // set the existing id
>>>>>>>>> Integer id = 1;
>>>>>>>>>
>>>>>>>>> Employee obj = null;
>>>>>>>>>
>>>>>>>>> try {
>>>>>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>>>>>> .beginTransaction();
>>>>>>>>> obj = (Employee)
>>>>>>>>> sessionFactory.getCurrentSession().get("Employee",id,
>>>>>>>>> LockMode.READ);
>>>>>>>>>
>>>>>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>>>>>
>>>>>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>>>>>> for (EmailAddresses email : eList) {
>>>>>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>>>>>> System.out.println("Email Address :: "
>>>>>>>>> + email.getEmailAddress());
>>>>>>>>> }
>>>>>>>>> txn.commit();
>>>>>>>>>
>>>>>>>>> } catch (Exception e) {
>>>>>>>>> e.printStackTrace();
>>>>>>>>> }
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> }
>>>>>>>>> *********************************************************
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Exceptions are:
>>>>>>>>>
>>>>>>>>> **********************************************************
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> log4j:WARN No appenders could be found for logger
>>>>>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>>>>> 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
>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 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:
>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>> Error creating bean with name 'employeeDAO' defined in class path
>>>>>>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>>>>>>> 'employeeSessionFactory' while setting bean property
>>>>>>>>> 'sessionFactory';
>>>>>>>>> nested exception is
>>>>>>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>>>>>>> creating bean with name 'employeeHbSessionDataStore' defined in
>>>>>>>>> class
>>>>>>>>> path resource [spring.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.person.teneo.
>>>>>>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> threw exception; nested exception is
>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter
>>>>>>>>> for
>>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>>> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ... 16 more
>>>>>>>>> Caused by:
>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>> Error creating bean with name 'employeeHbSessionDataStore'
>>>>>>>>> defined in
>>>>>>>>> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> threw exception; nested exception is
>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter
>>>>>>>>> for
>>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>>> 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)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ... 34 more
>>>>>>>>> Caused by:
>>>>>>>>> org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
>>>>>>>>> Factory method [public synchronized
>>>>>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore
>>>>>>>>> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> threw exception; nested exception is
>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter
>>>>>>>>> for
>>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>>> at
>>>>>>>>> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ... 58 more
>>>>>>>>> Caused by: org.hibernate.PropertyNotFoundException: Could not
>>>>>>>>> find a
>>>>>>>>> setter for property emailAddresses in class
>>>>>>>>> com.person.impl.EmployeeImpl
>>>>>>>>> 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)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>&
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #636622 is a reply to message #636541] |
Tue, 02 November 2010 08:55 |
Daniel Messages: 16 Registered: June 2010 |
Junior Member |
|
|
Hi,
sorry, I had some class not found exeptions.
I missed and added following classes:
-org/dom4j/DocumentException, added dom4j-1.6.1.jar
-org/slf4j/LoggerFactory, added slf4j-api-1.5.8.jar
-org/apache/log4j/Level, added log4j.jar
-jdbc driver
-org/apache/commons/collections/map/LRUMap, added commons-collection.jar
-javax/transaction/Synchronization, jboss-j2ee.jar
Now my example runs through and the debugger steps into
org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataSt ore().
No class not found exeptions at my server.
Daniel
Am 01.11.2010 20:41, schrieb Martin Taal:
> hmm, it sounds like that an exception occured, are you catching an
> exception somewhere maybe?
> For the rest I am kind of puzzled why debugging does not work as
> expected...
>
> gr. Martin
>
> On 11/01/2010 06:50 PM, Daniel Winz wrote:
>> The debugger gets off before at getConfiguration() and jumps into the
>> finally sequence. hbConfiguration = null.
>>
>> I tried to place the service-hibernate.xml that contains
>> hibernate-configuration at src and src/META-INF. But same result.
>>
>>
>>
>> Daniel
>>
>>
>>
>> Am 01.11.2010 17:09, schrieb Martin Taal:
>>> Hi Daniel,
>>> Inside the HbSessionDataStore.initialize method there is the call to
>>> initializeDataStore, what happens if you debug to that call and into it?
>>>
>>> gr. Martin
>>>
>>> On 11/01/2010 04:48 PM, Daniel Winz wrote:
>>>
>>>
>>>> Hi Martin,
>>>>
>>>>
>>>> the debugger doesn't stop at the breakpoint at initializeDataStore().
>>>> Instead it runs into HbSessionDataStore.initialize().
>>>>
>>>>
>>>> Breakpoint at initializeDataStore()
>>>> ***************************
>>>> protected void initializeDataStore() {
>>>> // buildmappings has to be done before setting the tuplizers because
>>>> // buildMappings will ensure that the element
>>>> // is set in the List properties.
>>>> BP: buildMappings();
>>>>
>>>> setInterceptor();
>>>> ***************************
>>>>
>>>>
>>>> My testcode:
>>>> ***********
>>>> public static void main(String[] args) {
>>>>
>>>> HbDataStore hbds =
>>>> (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb ");
>>>>
>>>> final Properties props = new Properties();
>>>> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
>>>> props.setProperty(Environment.URL,
>>>> "jdbc:mysql://127.0.0.1:3306/timetracker");
>>>> props.setProperty(Environment.USER, "root");
>>>> props.setProperty(Environment.PASS, "root");
>>>> props.setProperty(Environment.DIALECT,
>>>> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
>>>> props.setProperty(Environment.SHOW_SQL, "true");
>>>>
>>>> props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_C ONTAINMENT,
>>>> "REFRESH,PERSIST,MERGE");
>>>>
>>>> hbds.setProperties(props);
>>>>
>>>> hbds.setEPackages(new EPackage[]{TimetrackerPackage.eINSTANCE});
>>>> hbds.initialize();
>>>> ************
>>>>
>>>> ???
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Am 01.11.2010 15:18, schrieb Martin Taal:
>>>>> Can you check if the debugger stops in your own code where
>>>>> dataStore.initialize is called?
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> On 11/01/2010 11:52 AM, Daniel Winz wrote:
>>>>>> Teneo Version: 1.1.2.v201009161849
>>>>>>
>>>>>> The debugger doesn't stop at HbDataStore.initializeDataStore.
>>>>>>
>>>>>>
>>>>>> Daniel
>>>>>>
>>>>>>
>>>>>> Am 01.11.2010 11:16, schrieb Martin Taal:
>>>>>>> Hi Daniel,
>>>>>>> Hmm, it remains a strange thing as the setTuplizer is called from
>>>>>>> initialize. Can you set the breakpoint a bit earlier in the
>>>>>>> process in
>>>>>>> the HbDataStore.initializeDataStore method?
>>>>>>>
>>>>>>> Which version of Teneo are you using?
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>>>>>>> Hello Martin,
>>>>>>>>
>>>>>>>> I have the same problem and tried to debug into the setTuplizer
>>>>>>>> method.
>>>>>>>>
>>>>>>>> I.e. I
>>>>>>>> - started jboss 5.1
>>>>>>>> - started remote eclipse debugging session
>>>>>>>> - set a breakpoint at HbDataStore.setTuplizer()
>>>>>>>> - redeployed my package into default/deploy
>>>>>>>>
>>>>>>>> As my eclipse doesn't start to blink and I don't see the debugger
>>>>>>>> activated the breakpoint I assume the HbDataStore.setTuplizer is
>>>>>>>> not
>>>>>>>> called.
>>>>>>>>
>>>>>>>> Do you (or somebody else) have a solution please?
>>>>>>>>
>>>>>>>> Thank you
>>>>>>>> Daniel
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>>>>>>> Hi Ajay,
>>>>>>>>> It does not seem to use the EMFTuplizer but the standard
>>>>>>>>> PojoEntityTuplizer:
>>>>>>>>>
>>>>>>>>> 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)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> The tuplizer creates the accessors (setters/getters) used by
>>>>>>>>> Hibernate.
>>>>>>>>>
>>>>>>>>> Can you check/debug if the HbDataStore.setTuplizer() is called and
>>>>>>>>> what
>>>>>>>>> it does?
>>>>>>>>>
>>>>>>>>> gr. Martin
>>>>>>>>>
>>>>>>>>> Ajay Chauhan wrote:
>>>>>>>>>> Hello Martin,
>>>>>>>>>>
>>>>>>>>>> I am using two EMF classes and two DAOs (one for Employee and
>>>>>>>>>> other
>>>>>>>>>> one for EmailAddresses) for performimg operations on EMF objects.
>>>>>>>>>>
>>>>>>>>>> Testcases for both Employee and EmailAddresses are working fine
>>>>>>>>>> with
>>>>>>>>>> Teneo1.0.1 libraries but asking "setters" for EList type
>>>>>>>>>> attributes
>>>>>>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>>>>>>
>>>>>>>>>> The generated interfaces are as follows:
>>>>>>>>>> 1.EmailAddresses
>>>>>>>>>> 2.Employee
>>>>>>>>>>
>>>>>>>>>> The generated implementation classes are as follows:
>>>>>>>>>> 1.EmailAddressesImpl
>>>>>>>>>> 2.EmployeeImpl
>>>>>>>>>>
>>>>>>>>>> Two DAOs:
>>>>>>>>>> 1. DAO_Employee
>>>>>>>>>> 2. DAO_EmailAddress
>>>>>>>>>>
>>>>>>>>>> The association between Employee and EmailAddresses is a
>>>>>>>>>> bidirectional
>>>>>>>>>> one-to-many relationship.
>>>>>>>>>>
>>>>>>>>>> I am pasting complete Hbm file, Test class and Exception Log for
>>>>>>>>>> your
>>>>>>>>>> perusal.
>>>>>>>>>>
>>>>>>>>>> Hbm for these two classes are listed below:
>>>>>>>>>> **************************************************
>>>>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>>>>> <!-- Hibernate XML Mapping File -->
>>>>>>>>>> <!-- Author: U129098 -->
>>>>>>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>>>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>>>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>>>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>>>>>>> <hibernate-mapping auto-import="true">
>>>>>>>>>> <class
>>>>>>>>>> name="com.person.impl.EmployeeImpl"
>>>>>>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>>>>>>> dynamic-update="false"
>>>>>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>>>>>> abstract="false">
>>>>>>>>>> <id name="personId" column="employee_id">
>>>>>>>>>> <generator class="increment" />
>>>>>>>>>> </id>
>>>>>>>>>> <property name="name" insert="true" update="true" lazy="false"
>>>>>>>>>> optimistic-lock="true" not-null="true">
>>>>>>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>>>>>>> </property>
>>>>>>>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>>>>>>>> fetch="select" cascade="all" inverse="true">
>>>>>>>>>> <key column="owner_id" />
>>>>>>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>>>>>>> entity-name="EmailAddresses" /> </bag>
>>>>>>>>>> </class>
>>>>>>>>>> <class
>>>>>>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>>>>>>> table="email_address" entity-name="EmailAddresses" mutable="true"
>>>>>>>>>> dynamic-update="false"
>>>>>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>>>>>> abstract="false">
>>>>>>>>>> <id name="emailId" column="email_id">
>>>>>>>>>> <generator class="increment" />
>>>>>>>>>> </id>
>>>>>>>>>> <property name="emailAddress" insert="true" update="true"
>>>>>>>>>> lazy="false" optimistic-lock="true">
>>>>>>>>>> <column name="email_address" sql-type="varchar"
>>>>>>>>>> not-null="true" />
>>>>>>>>>> </property>
>>>>>>>>>> <many-to-one name="owner" column="owner_id"
>>>>>>>>>> not-null="true"
>>>>>>>>>> class="com.person.impl.EmployeeImpl"
>>>>>>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>>>>>>> </class>
>>>>>>>>>> </hibernate-mapping>
>>>>>>>>>>
>>>>>>>>>> **************************************************
>>>>>>>>>>
>>>>>>>>>> TestClass for Employee class:
>>>>>>>>>>
>>>>>>>>>> ***************************************************
>>>>>>>>>>
>>>>>>>>>> public class EmployeeMappingTest {
>>>>>>>>>> protected static final String CONTEXT_FILE_NAME = "spring.xml";
>>>>>>>>>> protected static final ConfigurableApplicationContext
>>>>>>>>>> springContext =
>>>>>>>>>> new ClassPathXmlApplicationContext(
>>>>>>>>>> CONTEXT_FILE_NAME);
>>>>>>>>>> DAO_Employee employeeDAO = null;
>>>>>>>>>> SessionFactory sessionFactory = null;
>>>>>>>>>>
>>>>>>>>>> /**
>>>>>>>>>> * SetUp method
>>>>>>>>>> */
>>>>>>>>>> @Before
>>>>>>>>>> public void setUp() throws Exception {
>>>>>>>>>> employeeDAO = (DAO_Employee)
>>>>>>>>>> springContext.getBean("employeeDAO");
>>>>>>>>>> sessionFactory = (SessionFactory) springContext
>>>>>>>>>> .getBean("sessionFactory");
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> @After
>>>>>>>>>> public void tearDown() throws Exception {
>>>>>>>>>> employeeDAO = null;
>>>>>>>>>> sessionFactory = null;
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> /**
>>>>>>>>>> * Test method for saving an Employee object
>>>>>>>>>> */
>>>>>>>>>> @Test
>>>>>>>>>> public void testSaveEmployee() {
>>>>>>>>>>
>>>>>>>>>> Employee employee = new EmployeeImpl();
>>>>>>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>>>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>>>>>>> emailAddress.setOwner(employee);
>>>>>>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>>>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>>>>>>> emailAddress1.setOwner(employee);
>>>>>>>>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>>>>>>>>> eList.add(emailAddress);
>>>>>>>>>> eList.add(emailAddress1);
>>>>>>>>>>
>>>>>>>>>> employee.setName("Ajay Chauhan");
>>>>>>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>>>>>>
>>>>>>>>>> try {
>>>>>>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>>>>>>> .beginTransaction();
>>>>>>>>>> employeeDAO.save(employee);
>>>>>>>>>> tx.commit();
>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>> e.printStackTrace();
>>>>>>>>>> } }
>>>>>>>>>>
>>>>>>>>>> /**
>>>>>>>>>> * Test method for Load
>>>>>>>>>> */
>>>>>>>>>> @Test
>>>>>>>>>> public void testLoadByIdID_Employee() {
>>>>>>>>>>
>>>>>>>>>> // set the existing id
>>>>>>>>>> Integer id = 1;
>>>>>>>>>>
>>>>>>>>>> Employee obj = null;
>>>>>>>>>>
>>>>>>>>>> try {
>>>>>>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>>>>>>> .beginTransaction();
>>>>>>>>>> obj = (Employee)
>>>>>>>>>> sessionFactory.getCurrentSession().get("Employee",id,
>>>>>>>>>> LockMode.READ);
>>>>>>>>>>
>>>>>>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>>>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>>>>>>
>>>>>>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>>>>>>> for (EmailAddresses email : eList) {
>>>>>>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>>>>>>> System.out.println("Email Address :: "
>>>>>>>>>> + email.getEmailAddress());
>>>>>>>>>> }
>>>>>>>>>> txn.commit();
>>>>>>>>>>
>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>> e.printStackTrace();
>>>>>>>>>> }
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> }
>>>>>>>>>> *********************************************************
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Exceptions are:
>>>>>>>>>>
>>>>>>>>>> **********************************************************
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> log4j:WARN No appenders could be found for logger
>>>>>>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>>>>>> 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
>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 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:
>>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>>> Error creating bean with name 'employeeDAO' defined in class path
>>>>>>>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>>>>>>>> 'employeeSessionFactory' while setting bean property
>>>>>>>>>> 'sessionFactory';
>>>>>>>>>> nested exception is
>>>>>>>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>>>>>>>> creating bean with name 'employeeHbSessionDataStore' defined in
>>>>>>>>>> class
>>>>>>>>>> path resource [spring.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.person.teneo.
>>>>>>>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> threw exception; nested exception is
>>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter
>>>>>>>>>> for
>>>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>>>> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ... 16 more
>>>>>>>>>> Caused by:
>>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>>> Error creating bean with name 'employeeHbSessionDataStore'
>>>>>>>>>> defined in
>>>>>>>>>> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> threw exception; nested exception is
>>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter
>>>>>>>>>> for
>>>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>>>> 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)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ... 34 more
>>>>>>>>>> Caused by:
>>>>>>>>>> org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
>>>>>>>>>> Factory method [public synchronized
>>>>>>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #636758 is a reply to message #636622] |
Tue, 02 November 2010 16:40 |
Daniel Messages: 16 Registered: June 2010 |
Junior Member |
|
|
Hello
unfortunately on deployment of my package I still get the exception:
***********
2010-11-02 17:02:19,051 ERROR
[org.jboss.kernel.plugins.dependency.AbstractKernelControlle r]
(HDScanner) Error installing to Start:
name=jboss.test.har:service=Hibernate,testcase=TimersUnitTes tCase
state=Create
org.hibernate.PropertyNotFoundException: Could not find a setter for
property project in class timetracker.impl.OperatorImpl
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)
************
I am new to teneo and maybe my understanding is totally wrong. But I am
wondering if ...
I have to configure something on server-side to enable the teneo
tuplizer? I copied all teneo libraries to the jboss default/lib folder.
Or is something wrong with my package ear configuration? But my test at
eclipse worked fine. All tables on mysql-db were created .. ?!
I downloaded the "org.eclipse.emf.teneo.hibernate.examples" example but
it doesn't contain any persistence or hibernate-configuration but
annotations.xml. I am a little confused about that.
Do you know an introduction especially for jboss and hibernate-mapping file?
Thank you
Daniel
Am 02.11.2010 09:55, schrieb Daniel Winz:
> Hi,
>
> sorry, I had some class not found exeptions.
>
> I missed and added following classes:
>
> -org/dom4j/DocumentException, added dom4j-1.6.1.jar
> -org/slf4j/LoggerFactory, added slf4j-api-1.5.8.jar
> -org/apache/log4j/Level, added log4j.jar
> -jdbc driver
> -org/apache/commons/collections/map/LRUMap, added commons-collection.jar
> -javax/transaction/Synchronization, jboss-j2ee.jar
>
> Now my example runs through and the debugger steps into
> org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataSt ore().
>
>
> No class not found exeptions at my server.
>
>
>
> Daniel
>
>
>
>
> Am 01.11.2010 20:41, schrieb Martin Taal:
>> hmm, it sounds like that an exception occured, are you catching an
>> exception somewhere maybe?
>> For the rest I am kind of puzzled why debugging does not work as
>> expected...
>>
>> gr. Martin
>>
>> On 11/01/2010 06:50 PM, Daniel Winz wrote:
>>> The debugger gets off before at getConfiguration() and jumps into the
>>> finally sequence. hbConfiguration = null.
>>>
>>> I tried to place the service-hibernate.xml that contains
>>> hibernate-configuration at src and src/META-INF. But same result.
>>>
>>>
>>>
>>> Daniel
>>>
>>>
>>>
>>> Am 01.11.2010 17:09, schrieb Martin Taal:
>>>> Hi Daniel,
>>>> Inside the HbSessionDataStore.initialize method there is the call to
>>>> initializeDataStore, what happens if you debug to that call and into
>>>> it?
>>>>
>>>> gr. Martin
>>>>
>>>> On 11/01/2010 04:48 PM, Daniel Winz wrote:
>>>>
>>>>
>>>>> Hi Martin,
>>>>>
>>>>>
>>>>> the debugger doesn't stop at the breakpoint at initializeDataStore().
>>>>> Instead it runs into HbSessionDataStore.initialize().
>>>>>
>>>>>
>>>>> Breakpoint at initializeDataStore()
>>>>> ***************************
>>>>> protected void initializeDataStore() {
>>>>> // buildmappings has to be done before setting the tuplizers because
>>>>> // buildMappings will ensure that the element
>>>>> // is set in the List properties.
>>>>> BP: buildMappings();
>>>>>
>>>>> setInterceptor();
>>>>> ***************************
>>>>>
>>>>>
>>>>> My testcode:
>>>>> ***********
>>>>> public static void main(String[] args) {
>>>>>
>>>>> HbDataStore hbds =
>>>>> (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb ");
>>>>>
>>>>> final Properties props = new Properties();
>>>>> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
>>>>> props.setProperty(Environment.URL,
>>>>> "jdbc:mysql://127.0.0.1:3306/timetracker");
>>>>> props.setProperty(Environment.USER, "root");
>>>>> props.setProperty(Environment.PASS, "root");
>>>>> props.setProperty(Environment.DIALECT,
>>>>> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
>>>>> props.setProperty(Environment.SHOW_SQL, "true");
>>>>>
>>>>> props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_C ONTAINMENT,
>>>>>
>>>>> "REFRESH,PERSIST,MERGE");
>>>>>
>>>>> hbds.setProperties(props);
>>>>>
>>>>> hbds.setEPackages(new EPackage[]{TimetrackerPackage.eINSTANCE});
>>>>> hbds.initialize();
>>>>> ************
>>>>>
>>>>> ???
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Am 01.11.2010 15:18, schrieb Martin Taal:
>>>>>> Can you check if the debugger stops in your own code where
>>>>>> dataStore.initialize is called?
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 11/01/2010 11:52 AM, Daniel Winz wrote:
>>>>>>> Teneo Version: 1.1.2.v201009161849
>>>>>>>
>>>>>>> The debugger doesn't stop at HbDataStore.initializeDataStore.
>>>>>>>
>>>>>>>
>>>>>>> Daniel
>>>>>>>
>>>>>>>
>>>>>>> Am 01.11.2010 11:16, schrieb Martin Taal:
>>>>>>>> Hi Daniel,
>>>>>>>> Hmm, it remains a strange thing as the setTuplizer is called from
>>>>>>>> initialize. Can you set the breakpoint a bit earlier in the
>>>>>>>> process in
>>>>>>>> the HbDataStore.initializeDataStore method?
>>>>>>>>
>>>>>>>> Which version of Teneo are you using?
>>>>>>>>
>>>>>>>> gr. Martin
>>>>>>>>
>>>>>>>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>>>>>>>> Hello Martin,
>>>>>>>>>
>>>>>>>>> I have the same problem and tried to debug into the setTuplizer
>>>>>>>>> method.
>>>>>>>>>
>>>>>>>>> I.e. I
>>>>>>>>> - started jboss 5.1
>>>>>>>>> - started remote eclipse debugging session
>>>>>>>>> - set a breakpoint at HbDataStore.setTuplizer()
>>>>>>>>> - redeployed my package into default/deploy
>>>>>>>>>
>>>>>>>>> As my eclipse doesn't start to blink and I don't see the debugger
>>>>>>>>> activated the breakpoint I assume the HbDataStore.setTuplizer is
>>>>>>>>> not
>>>>>>>>> called.
>>>>>>>>>
>>>>>>>>> Do you (or somebody else) have a solution please?
>>>>>>>>>
>>>>>>>>> Thank you
>>>>>>>>> Daniel
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>>>>>>>> Hi Ajay,
>>>>>>>>>> It does not seem to use the EMFTuplizer but the standard
>>>>>>>>>> PojoEntityTuplizer:
>>>>>>>>>>
>>>>>>>>>> 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)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> The tuplizer creates the accessors (setters/getters) used by
>>>>>>>>>> Hibernate.
>>>>>>>>>>
>>>>>>>>>> Can you check/debug if the HbDataStore.setTuplizer() is called
>>>>>>>>>> and
>>>>>>>>>> what
>>>>>>>>>> it does?
>>>>>>>>>>
>>>>>>>>>> gr. Martin
>>>>>>>>>>
>>>>>>>>>> Ajay Chauhan wrote:
>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>
>>>>>>>>>>> I am using two EMF classes and two DAOs (one for Employee and
>>>>>>>>>>> other
>>>>>>>>>>> one for EmailAddresses) for performimg operations on EMF
>>>>>>>>>>> objects.
>>>>>>>>>>>
>>>>>>>>>>> Testcases for both Employee and EmailAddresses are working fine
>>>>>>>>>>> with
>>>>>>>>>>> Teneo1.0.1 libraries but asking "setters" for EList type
>>>>>>>>>>> attributes
>>>>>>>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>>>>>>>
>>>>>>>>>>> The generated interfaces are as follows:
>>>>>>>>>>> 1.EmailAddresses
>>>>>>>>>>> 2.Employee
>>>>>>>>>>>
>>>>>>>>>>> The generated implementation classes are as follows:
>>>>>>>>>>> 1.EmailAddressesImpl
>>>>>>>>>>> 2.EmployeeImpl
>>>>>>>>>>>
>>>>>>>>>>> Two DAOs:
>>>>>>>>>>> 1. DAO_Employee
>>>>>>>>>>> 2. DAO_EmailAddress
>>>>>>>>>>>
>>>>>>>>>>> The association between Employee and EmailAddresses is a
>>>>>>>>>>> bidirectional
>>>>>>>>>>> one-to-many relationship.
>>>>>>>>>>>
>>>>>>>>>>> I am pasting complete Hbm file, Test class and Exception Log for
>>>>>>>>>>> your
>>>>>>>>>>> perusal.
>>>>>>>>>>>
>>>>>>>>>>> Hbm for these two classes are listed below:
>>>>>>>>>>> **************************************************
>>>>>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>>>>>> <!-- Hibernate XML Mapping File -->
>>>>>>>>>>> <!-- Author: U129098 -->
>>>>>>>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>>>>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>>>>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>>>>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>>>>>>>> <hibernate-mapping auto-import="true">
>>>>>>>>>>> <class
>>>>>>>>>>> name="com.person.impl.EmployeeImpl"
>>>>>>>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>>>>>>> abstract="false">
>>>>>>>>>>> <id name="personId" column="employee_id">
>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>> </id>
>>>>>>>>>>> <property name="name" insert="true" update="true" lazy="false"
>>>>>>>>>>> optimistic-lock="true" not-null="true">
>>>>>>>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>>>>>>>> </property>
>>>>>>>>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>>>>>>>>> fetch="select" cascade="all" inverse="true">
>>>>>>>>>>> <key column="owner_id" />
>>>>>>>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>> entity-name="EmailAddresses" /> </bag>
>>>>>>>>>>> </class>
>>>>>>>>>>> <class
>>>>>>>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>> table="email_address" entity-name="EmailAddresses"
>>>>>>>>>>> mutable="true"
>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>> dynamic-insert="false" select-before-update="false" lazy="false"
>>>>>>>>>>> abstract="false">
>>>>>>>>>>> <id name="emailId" column="email_id">
>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>> </id>
>>>>>>>>>>> <property name="emailAddress" insert="true" update="true"
>>>>>>>>>>> lazy="false" optimistic-lock="true">
>>>>>>>>>>> <column name="email_address" sql-type="varchar"
>>>>>>>>>>> not-null="true" />
>>>>>>>>>>> </property>
>>>>>>>>>>> <many-to-one name="owner" column="owner_id"
>>>>>>>>>>> not-null="true"
>>>>>>>>>>> class="com.person.impl.EmployeeImpl"
>>>>>>>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>>>>>>>> </class>
>>>>>>>>>>> </hibernate-mapping>
>>>>>>>>>>>
>>>>>>>>>>> **************************************************
>>>>>>>>>>>
>>>>>>>>>>> TestClass for Employee class:
>>>>>>>>>>>
>>>>>>>>>>> ***************************************************
>>>>>>>>>>>
>>>>>>>>>>> public class EmployeeMappingTest {
>>>>>>>>>>> protected static final String CONTEXT_FILE_NAME = "spring.xml";
>>>>>>>>>>> protected static final ConfigurableApplicationContext
>>>>>>>>>>> springContext =
>>>>>>>>>>> new ClassPathXmlApplicationContext(
>>>>>>>>>>> CONTEXT_FILE_NAME);
>>>>>>>>>>> DAO_Employee employeeDAO = null;
>>>>>>>>>>> SessionFactory sessionFactory = null;
>>>>>>>>>>>
>>>>>>>>>>> /**
>>>>>>>>>>> * SetUp method
>>>>>>>>>>> */
>>>>>>>>>>> @Before
>>>>>>>>>>> public void setUp() throws Exception {
>>>>>>>>>>> employeeDAO = (DAO_Employee)
>>>>>>>>>>> springContext.getBean("employeeDAO");
>>>>>>>>>>> sessionFactory = (SessionFactory) springContext
>>>>>>>>>>> .getBean("sessionFactory");
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> @After
>>>>>>>>>>> public void tearDown() throws Exception {
>>>>>>>>>>> employeeDAO = null;
>>>>>>>>>>> sessionFactory = null;
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> /**
>>>>>>>>>>> * Test method for saving an Employee object
>>>>>>>>>>> */
>>>>>>>>>>> @Test
>>>>>>>>>>> public void testSaveEmployee() {
>>>>>>>>>>>
>>>>>>>>>>> Employee employee = new EmployeeImpl();
>>>>>>>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>>>>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>>>>>>>> emailAddress.setOwner(employee);
>>>>>>>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>>>>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>>>>>>>> emailAddress1.setOwner(employee);
>>>>>>>>>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>>>>>>>>>> eList.add(emailAddress);
>>>>>>>>>>> eList.add(emailAddress1);
>>>>>>>>>>>
>>>>>>>>>>> employee.setName("Ajay Chauhan");
>>>>>>>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>>>>>>>
>>>>>>>>>>> try {
>>>>>>>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>> employeeDAO.save(employee);
>>>>>>>>>>> tx.commit();
>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>> } }
>>>>>>>>>>>
>>>>>>>>>>> /**
>>>>>>>>>>> * Test method for Load
>>>>>>>>>>> */
>>>>>>>>>>> @Test
>>>>>>>>>>> public void testLoadByIdID_Employee() {
>>>>>>>>>>>
>>>>>>>>>>> // set the existing id
>>>>>>>>>>> Integer id = 1;
>>>>>>>>>>>
>>>>>>>>>>> Employee obj = null;
>>>>>>>>>>>
>>>>>>>>>>> try {
>>>>>>>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>> obj = (Employee)
>>>>>>>>>>> sessionFactory.getCurrentSession().get("Employee",id,
>>>>>>>>>>> LockMode.READ);
>>>>>>>>>>>
>>>>>>>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>>>>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>>>>>>>
>>>>>>>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>>>>>>>> for (EmailAddresses email : eList) {
>>>>>>>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>>>>>>>> System.out.println("Email Address :: "
>>>>>>>>>>> + email.getEmailAddress());
>>>>>>>>>>> }
>>>>>>>>>>> txn.commit();
>>>>>>>>>>>
>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>> }
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> }
>>>>>>>>>>> *********************************************************
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Exceptions are:
>>>>>>>>>>>
>>>>>>>>>>> **********************************************************
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> log4j:WARN No appenders could be found for logger
>>>>>>>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>>>>>>> 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
>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> 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:
>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>>>> Error creating bean with name 'employeeDAO' defined in class
>>>>>>>>>>> path
>>>>>>>>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>>>>>>>>> 'employeeSessionFactory' while setting bean property
>>>>>>>>>>> 'sessionFactory';
>>>>>>>>>>> nested exception is
>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>>>>>>>>> creating bean with name 'employeeHbSessionDataStore' defined in
>>>>>>>>>>> class
>>>>>>>>>>> path resource [spring.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.person.teneo.
>>>>>>>>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> threw exception; nested exception is
>>>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter
>>>>>>>>>>> for
>>>>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>>>>> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ... 16 more
>>>>>>>>>>> Caused by:
>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>>>> Error creating bean with name 'employeeHbSessionDataStore'
>>>>>>>>>>> defined in
>>>>>>>>>>> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> threw exception; nested exception is
>>>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter
>>>>>>>>>>> for
>>>>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>>>>> 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)
>>>>>>>>>>>
>>
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #636783 is a reply to message #636758] |
Tue, 02 November 2010 18:40 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Daniel,
As a default the mapping is generated in memory, you can see the mapping by doing dataStore.getMappingXML(). My feel is
that the sessionfactory used at runtime is not created/provided by the DataStore but by some other means.
As a totally other solution, did I already mention the Texo project for you:
http://wiki.eclipse.org/Texo
It generates true pojos and the ORM with nice EMF-like features as XML/XMI persistence and a runtime model. The good
thing is that you don't need a runtime layer like Teneo, the generated code/orm works out of the box with
Hibernate/EclipseLink.
gr. Martin
On 11/02/2010 05:40 PM, Daniel Winz wrote:
> Hello
>
> unfortunately on deployment of my package I still get the exception:
>
> ***********
> 2010-11-02 17:02:19,051 ERROR
> [org.jboss.kernel.plugins.dependency.AbstractKernelControlle r]
> (HDScanner) Error installing to Start:
> name=jboss.test.har:service=Hibernate,testcase=TimersUnitTes tCase
> state=Create
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property project in class timetracker.impl.OperatorImpl
> 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)
>
> ************
>
> I am new to teneo and maybe my understanding is totally wrong. But I am
> wondering if ...
>
> I have to configure something on server-side to enable the teneo
> tuplizer? I copied all teneo libraries to the jboss default/lib folder.
>
> Or is something wrong with my package ear configuration? But my test at
> eclipse worked fine. All tables on mysql-db were created .. ?!
>
> I downloaded the "org.eclipse.emf.teneo.hibernate.examples" example but
> it doesn't contain any persistence or hibernate-configuration but
> annotations.xml. I am a little confused about that.
>
> Do you know an introduction especially for jboss and hibernate-mapping
> file?
>
>
> Thank you
> Daniel
>
>
>
>
>
>
>
> Am 02.11.2010 09:55, schrieb Daniel Winz:
>> Hi,
>>
>> sorry, I had some class not found exeptions.
>>
>> I missed and added following classes:
>>
>> -org/dom4j/DocumentException, added dom4j-1.6.1.jar
>> -org/slf4j/LoggerFactory, added slf4j-api-1.5.8.jar
>> -org/apache/log4j/Level, added log4j.jar
>> -jdbc driver
>> -org/apache/commons/collections/map/LRUMap, added commons-collection.jar
>> -javax/transaction/Synchronization, jboss-j2ee.jar
>>
>> Now my example runs through and the debugger steps into
>> org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataSt ore().
>>
>>
>> No class not found exeptions at my server.
>>
>>
>>
>> Daniel
>>
>>
>>
>>
>> Am 01.11.2010 20:41, schrieb Martin Taal:
>>> hmm, it sounds like that an exception occured, are you catching an
>>> exception somewhere maybe?
>>> For the rest I am kind of puzzled why debugging does not work as
>>> expected...
>>>
>>> gr. Martin
>>>
>>> On 11/01/2010 06:50 PM, Daniel Winz wrote:
>>>> The debugger gets off before at getConfiguration() and jumps into the
>>>> finally sequence. hbConfiguration = null.
>>>>
>>>> I tried to place the service-hibernate.xml that contains
>>>> hibernate-configuration at src and src/META-INF. But same result.
>>>>
>>>>
>>>>
>>>> Daniel
>>>>
>>>>
>>>>
>>>> Am 01.11.2010 17:09, schrieb Martin Taal:
>>>>> Hi Daniel,
>>>>> Inside the HbSessionDataStore.initialize method there is the call to
>>>>> initializeDataStore, what happens if you debug to that call and into
>>>>> it?
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> On 11/01/2010 04:48 PM, Daniel Winz wrote:
>>>>>
>>>>>
>>>>>> Hi Martin,
>>>>>>
>>>>>>
>>>>>> the debugger doesn't stop at the breakpoint at initializeDataStore().
>>>>>> Instead it runs into HbSessionDataStore.initialize().
>>>>>>
>>>>>>
>>>>>> Breakpoint at initializeDataStore()
>>>>>> ***************************
>>>>>> protected void initializeDataStore() {
>>>>>> // buildmappings has to be done before setting the tuplizers because
>>>>>> // buildMappings will ensure that the element
>>>>>> // is set in the List properties.
>>>>>> BP: buildMappings();
>>>>>>
>>>>>> setInterceptor();
>>>>>> ***************************
>>>>>>
>>>>>>
>>>>>> My testcode:
>>>>>> ***********
>>>>>> public static void main(String[] args) {
>>>>>>
>>>>>> HbDataStore hbds =
>>>>>> (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb ");
>>>>>>
>>>>>> final Properties props = new Properties();
>>>>>> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
>>>>>> props.setProperty(Environment.URL,
>>>>>> "jdbc:mysql://127.0.0.1:3306/timetracker");
>>>>>> props.setProperty(Environment.USER, "root");
>>>>>> props.setProperty(Environment.PASS, "root");
>>>>>> props.setProperty(Environment.DIALECT,
>>>>>> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
>>>>>> props.setProperty(Environment.SHOW_SQL, "true");
>>>>>>
>>>>>> props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_C ONTAINMENT,
>>>>>>
>>>>>>
>>>>>> "REFRESH,PERSIST,MERGE");
>>>>>>
>>>>>> hbds.setProperties(props);
>>>>>>
>>>>>> hbds.setEPackages(new EPackage[]{TimetrackerPackage.eINSTANCE});
>>>>>> hbds.initialize();
>>>>>> ************
>>>>>>
>>>>>> ???
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 01.11.2010 15:18, schrieb Martin Taal:
>>>>>>> Can you check if the debugger stops in your own code where
>>>>>>> dataStore.initialize is called?
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> On 11/01/2010 11:52 AM, Daniel Winz wrote:
>>>>>>>> Teneo Version: 1.1.2.v201009161849
>>>>>>>>
>>>>>>>> The debugger doesn't stop at HbDataStore.initializeDataStore.
>>>>>>>>
>>>>>>>>
>>>>>>>> Daniel
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 01.11.2010 11:16, schrieb Martin Taal:
>>>>>>>>> Hi Daniel,
>>>>>>>>> Hmm, it remains a strange thing as the setTuplizer is called from
>>>>>>>>> initialize. Can you set the breakpoint a bit earlier in the
>>>>>>>>> process in
>>>>>>>>> the HbDataStore.initializeDataStore method?
>>>>>>>>>
>>>>>>>>> Which version of Teneo are you using?
>>>>>>>>>
>>>>>>>>> gr. Martin
>>>>>>>>>
>>>>>>>>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>>>>>>>>> Hello Martin,
>>>>>>>>>>
>>>>>>>>>> I have the same problem and tried to debug into the setTuplizer
>>>>>>>>>> method.
>>>>>>>>>>
>>>>>>>>>> I.e. I
>>>>>>>>>> - started jboss 5.1
>>>>>>>>>> - started remote eclipse debugging session
>>>>>>>>>> - set a breakpoint at HbDataStore.setTuplizer()
>>>>>>>>>> - redeployed my package into default/deploy
>>>>>>>>>>
>>>>>>>>>> As my eclipse doesn't start to blink and I don't see the debugger
>>>>>>>>>> activated the breakpoint I assume the HbDataStore.setTuplizer is
>>>>>>>>>> not
>>>>>>>>>> called.
>>>>>>>>>>
>>>>>>>>>> Do you (or somebody else) have a solution please?
>>>>>>>>>>
>>>>>>>>>> Thank you
>>>>>>>>>> Daniel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>>>>>>>>> Hi Ajay,
>>>>>>>>>>> It does not seem to use the EMFTuplizer but the standard
>>>>>>>>>>> PojoEntityTuplizer:
>>>>>>>>>>>
>>>>>>>>>>> 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)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> The tuplizer creates the accessors (setters/getters) used by
>>>>>>>>>>> Hibernate.
>>>>>>>>>>>
>>>>>>>>>>> Can you check/debug if the HbDataStore.setTuplizer() is called
>>>>>>>>>>> and
>>>>>>>>>>> what
>>>>>>>>>>> it does?
>>>>>>>>>>>
>>>>>>>>>>> gr. Martin
>>>>>>>>>>>
>>>>>>>>>>> Ajay Chauhan wrote:
>>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>>
>>>>>>>>>>>> I am using two EMF classes and two DAOs (one for Employee and
>>>>>>>>>>>> other
>>>>>>>>>>>> one for EmailAddresses) for performimg operations on EMF
>>>>>>>>>>>> objects.
>>>>>>>>>>>>
>>>>>>>>>>>> Testcases for both Employee and EmailAddresses are working fine
>>>>>>>>>>>> with
>>>>>>>>>>>> Teneo1.0.1 libraries but asking "setters" for EList type
>>>>>>>>>>>> attributes
>>>>>>>>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>>>>>>>>
>>>>>>>>>>>> The generated interfaces are as follows:
>>>>>>>>>>>> 1.EmailAddresses
>>>>>>>>>>>> 2.Employee
>>>>>>>>>>>>
>>>>>>>>>>>> The generated implementation classes are as follows:
>>>>>>>>>>>> 1.EmailAddressesImpl
>>>>>>>>>>>> 2.EmployeeImpl
>>>>>>>>>>>>
>>>>>>>>>>>> Two DAOs:
>>>>>>>>>>>> 1. DAO_Employee
>>>>>>>>>>>> 2. DAO_EmailAddress
>>>>>>>>>>>>
>>>>>>>>>>>> The association between Employee and EmailAddresses is a
>>>>>>>>>>>> bidirectional
>>>>>>>>>>>> one-to-many relationship.
>>>>>>>>>>>>
>>>>>>>>>>>> I am pasting complete Hbm file, Test class and Exception Log
>>>>>>>>>>>> for
>>>>>>>>>>>> your
>>>>>>>>>>>> perusal.
>>>>>>>>>>>>
>>>>>>>>>>>> Hbm for these two classes are listed below:
>>>>>>>>>>>> **************************************************
>>>>>>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>>>>>>> <!-- Hibernate XML Mapping File -->
>>>>>>>>>>>> <!-- Author: U129098 -->
>>>>>>>>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>>>>>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>>>>>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>>>>>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>>>>>>>>> <hibernate-mapping auto-import="true">
>>>>>>>>>>>> <class
>>>>>>>>>>>> name="com.person.impl.EmployeeImpl"
>>>>>>>>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>>> dynamic-insert="false" select-before-update="false"
>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>> abstract="false">
>>>>>>>>>>>> <id name="personId" column="employee_id">
>>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>>> </id>
>>>>>>>>>>>> <property name="name" insert="true" update="true" lazy="false"
>>>>>>>>>>>> optimistic-lock="true" not-null="true">
>>>>>>>>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>>>>>>>>> </property>
>>>>>>>>>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>>>>>>>>>> fetch="select" cascade="all" inverse="true">
>>>>>>>>>>>> <key column="owner_id" />
>>>>>>>>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>>> entity-name="EmailAddresses" /> </bag>
>>>>>>>>>>>> </class>
>>>>>>>>>>>> <class
>>>>>>>>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>>> table="email_address" entity-name="EmailAddresses"
>>>>>>>>>>>> mutable="true"
>>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>>> dynamic-insert="false" select-before-update="false"
>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>> abstract="false">
>>>>>>>>>>>> <id name="emailId" column="email_id">
>>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>>> </id>
>>>>>>>>>>>> <property name="emailAddress" insert="true" update="true"
>>>>>>>>>>>> lazy="false" optimistic-lock="true">
>>>>>>>>>>>> <column name="email_address" sql-type="varchar"
>>>>>>>>>>>> not-null="true" />
>>>>>>>>>>>> </property>
>>>>>>>>>>>> <many-to-one name="owner" column="owner_id"
>>>>>>>>>>>> not-null="true"
>>>>>>>>>>>> class="com.person.impl.EmployeeImpl"
>>>>>>>>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>>>>>>>>> </class>
>>>>>>>>>>>> </hibernate-mapping>
>>>>>>>>>>>>
>>>>>>>>>>>> **************************************************
>>>>>>>>>>>>
>>>>>>>>>>>> TestClass for Employee class:
>>>>>>>>>>>>
>>>>>>>>>>>> ***************************************************
>>>>>>>>>>>>
>>>>>>>>>>>> public class EmployeeMappingTest {
>>>>>>>>>>>> protected static final String CONTEXT_FILE_NAME = "spring.xml";
>>>>>>>>>>>> protected static final ConfigurableApplicationContext
>>>>>>>>>>>> springContext =
>>>>>>>>>>>> new ClassPathXmlApplicationContext(
>>>>>>>>>>>> CONTEXT_FILE_NAME);
>>>>>>>>>>>> DAO_Employee employeeDAO = null;
>>>>>>>>>>>> SessionFactory sessionFactory = null;
>>>>>>>>>>>>
>>>>>>>>>>>> /**
>>>>>>>>>>>> * SetUp method
>>>>>>>>>>>> */
>>>>>>>>>>>> @Before
>>>>>>>>>>>> public void setUp() throws Exception {
>>>>>>>>>>>> employeeDAO = (DAO_Employee)
>>>>>>>>>>>> springContext.getBean("employeeDAO");
>>>>>>>>>>>> sessionFactory = (SessionFactory) springContext
>>>>>>>>>>>> .getBean("sessionFactory");
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> @After
>>>>>>>>>>>> public void tearDown() throws Exception {
>>>>>>>>>>>> employeeDAO = null;
>>>>>>>>>>>> sessionFactory = null;
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> /**
>>>>>>>>>>>> * Test method for saving an Employee object
>>>>>>>>>>>> */
>>>>>>>>>>>> @Test
>>>>>>>>>>>> public void testSaveEmployee() {
>>>>>>>>>>>>
>>>>>>>>>>>> Employee employee = new EmployeeImpl();
>>>>>>>>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>>>>>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>>>>>>>>> emailAddress.setOwner(employee);
>>>>>>>>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>>>>>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>>>>>>>>> emailAddress1.setOwner(employee);
>>>>>>>>>>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>>>>>>>>>>> eList.add(emailAddress);
>>>>>>>>>>>> eList.add(emailAddress1);
>>>>>>>>>>>>
>>>>>>>>>>>> employee.setName("Ajay Chauhan");
>>>>>>>>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>>>>>>>>
>>>>>>>>>>>> try {
>>>>>>>>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>>> employeeDAO.save(employee);
>>>>>>>>>>>> tx.commit();
>>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>>> } }
>>>>>>>>>>>>
>>>>>>>>>>>> /**
>>>>>>>>>>>> * Test method for Load
>>>>>>>>>>>> */
>>>>>>>>>>>> @Test
>>>>>>>>>>>> public void testLoadByIdID_Employee() {
>>>>>>>>>>>>
>>>>>>>>>>>> // set the existing id
>>>>>>>>>>>> Integer id = 1;
>>>>>>>>>>>>
>>>>>>>>>>>> Employee obj = null;
>>>>>>>>>>>>
>>>>>>>>>>>> try {
>>>>>>>>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>>> obj = (Employee)
>>>>>>>>>>>> sessionFactory.getCurrentSession().get("Employee",id,
>>>>>>>>>>>> LockMode.READ);
>>>>>>>>>>>>
>>>>>>>>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>>>>>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>>>>>>>>
>>>>>>>>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>>>>>>>>> for (EmailAddresses email : eList) {
>>>>>>>>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>>>>>>>>> System.out.println("Email Address :: "
>>>>>>>>>>>> + email.getEmailAddress());
>>>>>>>>>>>> }
>>>>>>>>>>>> txn.commit();
>>>>>>>>>>>>
>>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>>> }
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> }
>>>>>>>>>>>> *********************************************************
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Exceptions are:
>>>>>>>>>>>>
>>>>>>>>>>>> **********************************************************
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> log4j:WARN No appenders could be found for logger
>>>>>>>>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>>>>>>>> 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
>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> at
>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> at
>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> at
>>>>>>>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> at
>>>>>>>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> at
>>>>>>>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> 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:
>>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>>>>> Error creating bean with name 'employeeDAO' defined in class
>>>>>>>>>>>> path
>>>>>>>>>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>>>>>>>>>> 'employeeSessionFactory' while setting bean property
>>>>>>>>>>>> 'sessionFactory';
>>>>>>>>>>>> nested exception is
>>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>>>>>>>>>> creating bean with name 'employeeHbSessionDataStore' defined in
>>>>>>>>>>>> class
>>>>>>>>>>>> path resource [spring.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.person.teneo.
>>>>>>>>>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> threw exception; nested exception is
>>>>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a
>>>>>>>>>>>> setter
>>>>>>>>>>>> for
>>>>>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>>>>>> 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.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ... 16 more
>>>>>>>>>>>> Caused by:
>>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>>>>> Error creating bean with name 'employeeHbSessionDataStore'
>>>>>>>>>>>> defined in
>>>>>>>>>>>> class path resource [spring.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.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> threw exception; nested exception is
>>>>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a
>>>>>>>>>>>> setter
>>>>>>>>>>>> for
>>>>>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>>>>>> at
>>>>>>>>>>>> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:444 )
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>&g
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #637588 is a reply to message #636783] |
Sun, 07 November 2010 11:34 |
Daniel Messages: 16 Registered: June 2010 |
Junior Member |
|
|
Hi Martin,
thank you very much for the hints. I will consider using texo next.
But at the moment, unfortunately, I am a little fixated on teneo. I
can't give in yet.
Meanwhile I read Sebastian Tomschke's blog
( http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-s pring-transactions-opensessioninviewfilter/lang/de/)
that describes a problem concerning the Hibernate SessionFactory: "The
HibernateTransactionManager does NOT get the
teneoSessionFactory(HbSessionDataStore) object passed in as
sessionFactory, but the underlying Hibernate SessionFactory that can be
retrieved from the HbSessionDataStore via the getSessionFactory()
method. Not doing so will result in duplicate Hibernate Sessions
completely breaking the transaction managment." (Tomschke)
Regarding your assumption I am wondering if I am facing the same problem
described by Tomschke.
Kindly
Daniel
Am 02.11.2010 19:40, schrieb Martin Taal:
> Hi Daniel,
> As a default the mapping is generated in memory, you can see the mapping
> by doing dataStore.getMappingXML(). My feel is that the sessionfactory
> used at runtime is not created/provided by the DataStore but by some
> other means.
>
> As a totally other solution, did I already mention the Texo project for
> you:
> http://wiki.eclipse.org/Texo
>
> It generates true pojos and the ORM with nice EMF-like features as
> XML/XMI persistence and a runtime model. The good thing is that you
> don't need a runtime layer like Teneo, the generated code/orm works out
> of the box with Hibernate/EclipseLink.
>
> gr. Martin
>
> On 11/02/2010 05:40 PM, Daniel Winz wrote:
>> Hello
>>
>> unfortunately on deployment of my package I still get the exception:
>>
>> ***********
>> 2010-11-02 17:02:19,051 ERROR
>> [org.jboss.kernel.plugins.dependency.AbstractKernelControlle r]
>> (HDScanner) Error installing to Start:
>> name=jboss.test.har:service=Hibernate,testcase=TimersUnitTes tCase
>> state=Create
>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>> property project in class timetracker.impl.OperatorImpl
>> 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)
>>
>>
>> ************
>>
>> I am new to teneo and maybe my understanding is totally wrong. But I am
>> wondering if ...
>>
>> I have to configure something on server-side to enable the teneo
>> tuplizer? I copied all teneo libraries to the jboss default/lib folder.
>>
>> Or is something wrong with my package ear configuration? But my test at
>> eclipse worked fine. All tables on mysql-db were created .. ?!
>>
>> I downloaded the "org.eclipse.emf.teneo.hibernate.examples" example but
>> it doesn't contain any persistence or hibernate-configuration but
>> annotations.xml. I am a little confused about that.
>>
>> Do you know an introduction especially for jboss and hibernate-mapping
>> file?
>>
>>
>> Thank you
>> Daniel
>>
>>
>>
>>
>>
>>
>>
>> Am 02.11.2010 09:55, schrieb Daniel Winz:
>>> Hi,
>>>
>>> sorry, I had some class not found exeptions.
>>>
>>> I missed and added following classes:
>>>
>>> -org/dom4j/DocumentException, added dom4j-1.6.1.jar
>>> -org/slf4j/LoggerFactory, added slf4j-api-1.5.8.jar
>>> -org/apache/log4j/Level, added log4j.jar
>>> -jdbc driver
>>> -org/apache/commons/collections/map/LRUMap, added commons-collection.jar
>>> -javax/transaction/Synchronization, jboss-j2ee.jar
>>>
>>> Now my example runs through and the debugger steps into
>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataSt ore().
>>>
>>>
>>> No class not found exeptions at my server.
>>>
>>>
>>>
>>> Daniel
>>>
>>>
>>>
>>>
>>> Am 01.11.2010 20:41, schrieb Martin Taal:
>>>> hmm, it sounds like that an exception occured, are you catching an
>>>> exception somewhere maybe?
>>>> For the rest I am kind of puzzled why debugging does not work as
>>>> expected...
>>>>
>>>> gr. Martin
>>>>
>>>> On 11/01/2010 06:50 PM, Daniel Winz wrote:
>>>>> The debugger gets off before at getConfiguration() and jumps into the
>>>>> finally sequence. hbConfiguration = null.
>>>>>
>>>>> I tried to place the service-hibernate.xml that contains
>>>>> hibernate-configuration at src and src/META-INF. But same result.
>>>>>
>>>>>
>>>>>
>>>>> Daniel
>>>>>
>>>>>
>>>>>
>>>>> Am 01.11.2010 17:09, schrieb Martin Taal:
>>>>>> Hi Daniel,
>>>>>> Inside the HbSessionDataStore.initialize method there is the call to
>>>>>> initializeDataStore, what happens if you debug to that call and into
>>>>>> it?
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 11/01/2010 04:48 PM, Daniel Winz wrote:
>>>>>>
>>>>>>
>>>>>>> Hi Martin,
>>>>>>>
>>>>>>>
>>>>>>> the debugger doesn't stop at the breakpoint at
>>>>>>> initializeDataStore().
>>>>>>> Instead it runs into HbSessionDataStore.initialize().
>>>>>>>
>>>>>>>
>>>>>>> Breakpoint at initializeDataStore()
>>>>>>> ***************************
>>>>>>> protected void initializeDataStore() {
>>>>>>> // buildmappings has to be done before setting the tuplizers because
>>>>>>> // buildMappings will ensure that the element
>>>>>>> // is set in the List properties.
>>>>>>> BP: buildMappings();
>>>>>>>
>>>>>>> setInterceptor();
>>>>>>> ***************************
>>>>>>>
>>>>>>>
>>>>>>> My testcode:
>>>>>>> ***********
>>>>>>> public static void main(String[] args) {
>>>>>>>
>>>>>>> HbDataStore hbds =
>>>>>>> (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb ");
>>>>>>>
>>>>>>> final Properties props = new Properties();
>>>>>>> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
>>>>>>> props.setProperty(Environment.URL,
>>>>>>> "jdbc:mysql://127.0.0.1:3306/timetracker");
>>>>>>> props.setProperty(Environment.USER, "root");
>>>>>>> props.setProperty(Environment.PASS, "root");
>>>>>>> props.setProperty(Environment.DIALECT,
>>>>>>> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
>>>>>>> props.setProperty(Environment.SHOW_SQL, "true");
>>>>>>>
>>>>>>> props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_C ONTAINMENT,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> "REFRESH,PERSIST,MERGE");
>>>>>>>
>>>>>>> hbds.setProperties(props);
>>>>>>>
>>>>>>> hbds.setEPackages(new EPackage[]{TimetrackerPackage.eINSTANCE});
>>>>>>> hbds.initialize();
>>>>>>> ************
>>>>>>>
>>>>>>> ???
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Am 01.11.2010 15:18, schrieb Martin Taal:
>>>>>>>> Can you check if the debugger stops in your own code where
>>>>>>>> dataStore.initialize is called?
>>>>>>>>
>>>>>>>> gr. Martin
>>>>>>>>
>>>>>>>> On 11/01/2010 11:52 AM, Daniel Winz wrote:
>>>>>>>>> Teneo Version: 1.1.2.v201009161849
>>>>>>>>>
>>>>>>>>> The debugger doesn't stop at HbDataStore.initializeDataStore.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Daniel
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Am 01.11.2010 11:16, schrieb Martin Taal:
>>>>>>>>>> Hi Daniel,
>>>>>>>>>> Hmm, it remains a strange thing as the setTuplizer is called from
>>>>>>>>>> initialize. Can you set the breakpoint a bit earlier in the
>>>>>>>>>> process in
>>>>>>>>>> the HbDataStore.initializeDataStore method?
>>>>>>>>>>
>>>>>>>>>> Which version of Teneo are you using?
>>>>>>>>>>
>>>>>>>>>> gr. Martin
>>>>>>>>>>
>>>>>>>>>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>
>>>>>>>>>>> I have the same problem and tried to debug into the setTuplizer
>>>>>>>>>>> method.
>>>>>>>>>>>
>>>>>>>>>>> I.e. I
>>>>>>>>>>> - started jboss 5.1
>>>>>>>>>>> - started remote eclipse debugging session
>>>>>>>>>>> - set a breakpoint at HbDataStore.setTuplizer()
>>>>>>>>>>> - redeployed my package into default/deploy
>>>>>>>>>>>
>>>>>>>>>>> As my eclipse doesn't start to blink and I don't see the
>>>>>>>>>>> debugger
>>>>>>>>>>> activated the breakpoint I assume the HbDataStore.setTuplizer is
>>>>>>>>>>> not
>>>>>>>>>>> called.
>>>>>>>>>>>
>>>>>>>>>>> Do you (or somebody else) have a solution please?
>>>>>>>>>>>
>>>>>>>>>>> Thank you
>>>>>>>>>>> Daniel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>>>>>>>>>> Hi Ajay,
>>>>>>>>>>>> It does not seem to use the EMFTuplizer but the standard
>>>>>>>>>>>> PojoEntityTuplizer:
>>>>>>>>>>>>
>>>>>>>>>>>> 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)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> The tuplizer creates the accessors (setters/getters) used by
>>>>>>>>>>>> Hibernate.
>>>>>>>>>>>>
>>>>>>>>>>>> Can you check/debug if the HbDataStore.setTuplizer() is called
>>>>>>>>>>>> and
>>>>>>>>>>>> what
>>>>>>>>>>>> it does?
>>>>>>>>>>>>
>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>
>>>>>>>>>>>> Ajay Chauhan wrote:
>>>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I am using two EMF classes and two DAOs (one for Employee and
>>>>>>>>>>>>> other
>>>>>>>>>>>>> one for EmailAddresses) for performimg operations on EMF
>>>>>>>>>>>>> objects.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Testcases for both Employee and EmailAddresses are working
>>>>>>>>>>>>> fine
>>>>>>>>>>>>> with
>>>>>>>>>>>>> Teneo1.0.1 libraries but asking "setters" for EList type
>>>>>>>>>>>>> attributes
>>>>>>>>>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>>>>>>>>>
>>>>>>>>>>>>> The generated interfaces are as follows:
>>>>>>>>>>>>> 1.EmailAddresses
>>>>>>>>>>>>> 2.Employee
>>>>>>>>>>>>>
>>>>>>>>>>>>> The generated implementation classes are as follows:
>>>>>>>>>>>>> 1.EmailAddressesImpl
>>>>>>>>>>>>> 2.EmployeeImpl
>>>>>>>>>>>>>
>>>>>>>>>>>>> Two DAOs:
>>>>>>>>>>>>> 1. DAO_Employee
>>>>>>>>>>>>> 2. DAO_EmailAddress
>>>>>>>>>>>>>
>>>>>>>>>>>>> The association between Employee and EmailAddresses is a
>>>>>>>>>>>>> bidirectional
>>>>>>>>>>>>> one-to-many relationship.
>>>>>>>>>>>>>
>>>>>>>>>>>>> I am pasting complete Hbm file, Test class and Exception Log
>>>>>>>>>>>>> for
>>>>>>>>>>>>> your
>>>>>>>>>>>>> perusal.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hbm for these two classes are listed below:
>>>>>>>>>>>>> **************************************************
>>>>>>>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>>>>>>>> <!-- Hibernate XML Mapping File -->
>>>>>>>>>>>>> <!-- Author: U129098 -->
>>>>>>>>>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>>>>>>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>>>>>>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>>>>>>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>>>>>>>>>> <hibernate-mapping auto-import="true">
>>>>>>>>>>>>> <class
>>>>>>>>>>>>> name="com.person.impl.EmployeeImpl"
>>>>>>>>>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>>>> dynamic-insert="false" select-before-update="false"
>>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>>> abstract="false">
>>>>>>>>>>>>> <id name="personId" column="employee_id">
>>>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>>>> </id>
>>>>>>>>>>>>> <property name="name" insert="true" update="true" lazy="false"
>>>>>>>>>>>>> optimistic-lock="true" not-null="true">
>>>>>>>>>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>>>>>>>>>> </property>
>>>>>>>>>>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>>>>>>>>>>> fetch="select" cascade="all" inverse="true">
>>>>>>>>>>>>> <key column="owner_id" />
>>>>>>>>>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>>>> entity-name="EmailAddresses" /> </bag>
>>>>>>>>>>>>> </class>
>>>>>>>>>>>>> <class
>>>>>>>>>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>>>> table="email_address" entity-name="EmailAddresses"
>>>>>>>>>>>>> mutable="true"
>>>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>>>> dynamic-insert="false" select-before-update="false"
>>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>>> abstract="false">
>>>>>>>>>>>>> <id name="emailId" column="email_id">
>>>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>>>> </id>
>>>>>>>>>>>>> <property name="emailAddress" insert="true" update="true"
>>>>>>>>>>>>> lazy="false" optimistic-lock="true">
>>>>>>>>>>>>> <column name="email_address" sql-type="varchar"
>>>>>>>>>>>>> not-null="true" />
>>>>>>>>>>>>> </property>
>>>>>>>>>>>>> <many-to-one name="owner" column="owner_id"
>>>>>>>>>>>>> not-null="true"
>>>>>>>>>>>>> class="com.person.impl.EmployeeImpl"
>>>>>>>>>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>>>>>>>>>> </class>
>>>>>>>>>>>>> </hibernate-mapping>
>>>>>>>>>>>>>
>>>>>>>>>>>>> **************************************************
>>>>>>>>>>>>>
>>>>>>>>>>>>> TestClass for Employee class:
>>>>>>>>>>>>>
>>>>>>>>>>>>> ***************************************************
>>>>>>>>>>>>>
>>>>>>>>>>>>> public class EmployeeMappingTest {
>>>>>>>>>>>>> protected static final String CONTEXT_FILE_NAME =
>>>>>>>>>>>>> "spring.xml";
>>>>>>>>>>>>> protected static final ConfigurableApplicationContext
>>>>>>>>>>>>> springContext =
>>>>>>>>>>>>> new ClassPathXmlApplicationContext(
>>>>>>>>>>>>> CONTEXT_FILE_NAME);
>>>>>>>>>>>>> DAO_Employee employeeDAO = null;
>>>>>>>>>>>>> SessionFactory sessionFactory = null;
>>>>>>>>>>>>>
>>>>>>>>>>>>> /**
>>>>>>>>>>>>> * SetUp method
>>>>>>>>>>>>> */
>>>>>>>>>>>>> @Before
>>>>>>>>>>>>> public void setUp() throws Exception {
>>>>>>>>>>>>> employeeDAO = (DAO_Employee)
>>>>>>>>>>>>> springContext.getBean("employeeDAO");
>>>>>>>>>>>>> sessionFactory = (SessionFactory) springContext
>>>>>>>>>>>>> .getBean("sessionFactory");
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> @After
>>>>>>>>>>>>> public void tearDown() throws Exception {
>>>>>>>>>>>>> employeeDAO = null;
>>>>>>>>>>>>> sessionFactory = null;
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> /**
>>>>>>>>>>>>> * Test method for saving an Employee object
>>>>>>>>>>>>> */
>>>>>>>>>>>>> @Test
>>>>>>>>>>>>> public void testSaveEmployee() {
>>>>>>>>>>>>>
>>>>>>>>>>>>> Employee employee = new EmployeeImpl();
>>>>>>>>>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>>>>>>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>>>>>>>>>> emailAddress.setOwner(employee);
>>>>>>>>>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>>>>>>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>>>>>>>>>> emailAddress1.setOwner(employee);
>>>>>>>>>>>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>>>>>>>>>>>> eList.add(emailAddress);
>>>>>>>>>>>>> eList.add(emailAddress1);
>>>>>>>>>>>>>
>>>>>>>>>>>>> employee.setName("Ajay Chauhan");
>>>>>>>>>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>>>>>>>>>
>>>>>>>>>>>>> try {
>>>>>>>>>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>>>> employeeDAO.save(employee);
>>>>>>>>>>>>> tx.commit();
>>>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>>>> } }
>>>>>>>>>>>>>
>>>>>>>>>>>>> /**
>>>>>>>>>>>>> * Test method for Load
>>>>>>>>>>>>> */
>>>>>>>>>>>>> @Test
>>>>>>>>>>>>> public void testLoadByIdID_Employee() {
>>>>>>>>>>>>>
>>>>>>>>>>>>> // set the existing id
>>>>>>>>>>>>> Integer id = 1;
>>>>>>>>>>>>>
>>>>>>>>>>>>> Employee obj = null;
>>>>>>>>>>>>>
>>>>>>>>>>>>> try {
>>>>>>>>>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>>>> obj = (Employee)
>>>>>>>>>>>>> sessionFactory.getCurrentSession().get("Employee",id,
>>>>>>>>>>>>> LockMode.READ);
>>>>>>>>>>>>>
>>>>>>>>>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>>>>>>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>>>>>>>>>
>>>>>>>>>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>>>>>>>>>> for (EmailAddresses email : eList) {
>>>>>>>>>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>>>>>>>>>> System.out.println("Email Address :: "
>>>>>>>>>>>>> + email.getEmailAddress());
>>>>>>>>>>>>> }
>>>>>>>>>>>>> txn.commit();
>>>>>>>>>>>>>
>>>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>>>> }
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> }
>>>>>>>>>>>>> *********************************************************
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Exceptions are:
>>>>>>>>>>>>>
>>>>>>>>>>>>> **********************************************************
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> log4j:WARN No appenders could be found for logger
>>>>>>>>>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>>>>>>>>> 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
>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at
>>>>>>>>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> 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:
>>>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>>>>>> Error creating bean with name 'employeeDAO' defined in class
>>>>>>>>>>>>> path
>>>>>>>>>>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>>>>>>>>>>> 'employeeSessionFactory' while setting bean property
>>>>>>>>>>>>> 'sessionFactory';
>>>>>>>>>>>>> nested exception is
>>>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>>>>>>>>>>> creating bean with name 'employeeHbSessionDataStore'
>>>>>>>>>>>>> defined in
>>>>>>>>>>>>> class
>>>>>>>>>>>>> path resource [spring.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.person.teneo.
>>>>>>>>>>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> threw exception; nested exception is
>>>>>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a
>>>>>>>>>>>>> setter
>>>>>>>>>>>>> for
>>>>>>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>>>>>>> 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
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #637591 is a reply to message #637588] |
Sun, 07 November 2010 12:31 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Daniel,
The link gives me a 404/can't connect with the browser, can you check if it is correct?
I am not sure if this could be the problem, the HbSessionDataStore is just a wrapper around the internal SessionFactory,
most testcases of Teneo uses the SessionFactory provided by the HbSessionDataStore directly.So going through the
HbSessionDataStore api or directly to its SessionFactory does not make a difference afaicu.
gr. Martin
On 11/07/2010 12:34 PM, Daniel Winz wrote:
> Hi Martin,
>
> thank you very much for the hints. I will consider using texo next.
>
> But at the moment, unfortunately, I am a little fixated on teneo. I
> can't give in yet.
>
> Meanwhile I read Sebastian Tomschke's blog
> ( http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-s pring-transactions-opensessioninviewfilter/lang/de/)
> that describes a problem concerning the Hibernate SessionFactory: "The
> HibernateTransactionManager does NOT get the
> teneoSessionFactory(HbSessionDataStore) object passed in as
> sessionFactory, but the underlying Hibernate SessionFactory that can be
> retrieved from the HbSessionDataStore via the getSessionFactory()
> method. Not doing so will result in duplicate Hibernate Sessions
> completely breaking the transaction managment." (Tomschke)
>
> Regarding your assumption I am wondering if I am facing the same problem
> described by Tomschke.
>
>
> Kindly
> Daniel
>
>
>
> Am 02.11.2010 19:40, schrieb Martin Taal:
>> Hi Daniel,
>> As a default the mapping is generated in memory, you can see the mapping
>> by doing dataStore.getMappingXML(). My feel is that the sessionfactory
>> used at runtime is not created/provided by the DataStore but by some
>> other means.
>>
>> As a totally other solution, did I already mention the Texo project for
>> you:
>> http://wiki.eclipse.org/Texo
>>
>> It generates true pojos and the ORM with nice EMF-like features as
>> XML/XMI persistence and a runtime model. The good thing is that you
>> don't need a runtime layer like Teneo, the generated code/orm works out
>> of the box with Hibernate/EclipseLink.
>>
>> gr. Martin
>>
>> On 11/02/2010 05:40 PM, Daniel Winz wrote:
>>> Hello
>>>
>>> unfortunately on deployment of my package I still get the exception:
>>>
>>> ***********
>>> 2010-11-02 17:02:19,051 ERROR
>>> [org.jboss.kernel.plugins.dependency.AbstractKernelControlle r]
>>> (HDScanner) Error installing to Start:
>>> name=jboss.test.har:service=Hibernate,testcase=TimersUnitTes tCase
>>> state=Create
>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>> property project in class timetracker.impl.OperatorImpl
>>> 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)
>>>
>>>
>>>
>>> ************
>>>
>>> I am new to teneo and maybe my understanding is totally wrong. But I am
>>> wondering if ...
>>>
>>> I have to configure something on server-side to enable the teneo
>>> tuplizer? I copied all teneo libraries to the jboss default/lib folder.
>>>
>>> Or is something wrong with my package ear configuration? But my test at
>>> eclipse worked fine. All tables on mysql-db were created .. ?!
>>>
>>> I downloaded the "org.eclipse.emf.teneo.hibernate.examples" example but
>>> it doesn't contain any persistence or hibernate-configuration but
>>> annotations.xml. I am a little confused about that.
>>>
>>> Do you know an introduction especially for jboss and hibernate-mapping
>>> file?
>>>
>>>
>>> Thank you
>>> Daniel
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Am 02.11.2010 09:55, schrieb Daniel Winz:
>>>> Hi,
>>>>
>>>> sorry, I had some class not found exeptions.
>>>>
>>>> I missed and added following classes:
>>>>
>>>> -org/dom4j/DocumentException, added dom4j-1.6.1.jar
>>>> -org/slf4j/LoggerFactory, added slf4j-api-1.5.8.jar
>>>> -org/apache/log4j/Level, added log4j.jar
>>>> -jdbc driver
>>>> -org/apache/commons/collections/map/LRUMap, added
>>>> commons-collection.jar
>>>> -javax/transaction/Synchronization, jboss-j2ee.jar
>>>>
>>>> Now my example runs through and the debugger steps into
>>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataSt ore().
>>>>
>>>>
>>>> No class not found exeptions at my server.
>>>>
>>>>
>>>>
>>>> Daniel
>>>>
>>>>
>>>>
>>>>
>>>> Am 01.11.2010 20:41, schrieb Martin Taal:
>>>>> hmm, it sounds like that an exception occured, are you catching an
>>>>> exception somewhere maybe?
>>>>> For the rest I am kind of puzzled why debugging does not work as
>>>>> expected...
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> On 11/01/2010 06:50 PM, Daniel Winz wrote:
>>>>>> The debugger gets off before at getConfiguration() and jumps into the
>>>>>> finally sequence. hbConfiguration = null.
>>>>>>
>>>>>> I tried to place the service-hibernate.xml that contains
>>>>>> hibernate-configuration at src and src/META-INF. But same result.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Daniel
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 01.11.2010 17:09, schrieb Martin Taal:
>>>>>>> Hi Daniel,
>>>>>>> Inside the HbSessionDataStore.initialize method there is the call to
>>>>>>> initializeDataStore, what happens if you debug to that call and into
>>>>>>> it?
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> On 11/01/2010 04:48 PM, Daniel Winz wrote:
>>>>>>>
>>>>>>>
>>>>>>>> Hi Martin,
>>>>>>>>
>>>>>>>>
>>>>>>>> the debugger doesn't stop at the breakpoint at
>>>>>>>> initializeDataStore().
>>>>>>>> Instead it runs into HbSessionDataStore.initialize().
>>>>>>>>
>>>>>>>>
>>>>>>>> Breakpoint at initializeDataStore()
>>>>>>>> ***************************
>>>>>>>> protected void initializeDataStore() {
>>>>>>>> // buildmappings has to be done before setting the tuplizers
>>>>>>>> because
>>>>>>>> // buildMappings will ensure that the element
>>>>>>>> // is set in the List properties.
>>>>>>>> BP: buildMappings();
>>>>>>>>
>>>>>>>> setInterceptor();
>>>>>>>> ***************************
>>>>>>>>
>>>>>>>>
>>>>>>>> My testcode:
>>>>>>>> ***********
>>>>>>>> public static void main(String[] args) {
>>>>>>>>
>>>>>>>> HbDataStore hbds =
>>>>>>>> (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb ");
>>>>>>>>
>>>>>>>> final Properties props = new Properties();
>>>>>>>> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
>>>>>>>> props.setProperty(Environment.URL,
>>>>>>>> "jdbc:mysql://127.0.0.1:3306/timetracker");
>>>>>>>> props.setProperty(Environment.USER, "root");
>>>>>>>> props.setProperty(Environment.PASS, "root");
>>>>>>>> props.setProperty(Environment.DIALECT,
>>>>>>>> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
>>>>>>>> props.setProperty(Environment.SHOW_SQL, "true");
>>>>>>>>
>>>>>>>> props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_C ONTAINMENT,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> "REFRESH,PERSIST,MERGE");
>>>>>>>>
>>>>>>>> hbds.setProperties(props);
>>>>>>>>
>>>>>>>> hbds.setEPackages(new EPackage[]{TimetrackerPackage.eINSTANCE});
>>>>>>>> hbds.initialize();
>>>>>>>> ************
>>>>>>>>
>>>>>>>> ???
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 01.11.2010 15:18, schrieb Martin Taal:
>>>>>>>>> Can you check if the debugger stops in your own code where
>>>>>>>>> dataStore.initialize is called?
>>>>>>>>>
>>>>>>>>> gr. Martin
>>>>>>>>>
>>>>>>>>> On 11/01/2010 11:52 AM, Daniel Winz wrote:
>>>>>>>>>> Teneo Version: 1.1.2.v201009161849
>>>>>>>>>>
>>>>>>>>>> The debugger doesn't stop at HbDataStore.initializeDataStore.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Daniel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Am 01.11.2010 11:16, schrieb Martin Taal:
>>>>>>>>>>> Hi Daniel,
>>>>>>>>>>> Hmm, it remains a strange thing as the setTuplizer is called
>>>>>>>>>>> from
>>>>>>>>>>> initialize. Can you set the breakpoint a bit earlier in the
>>>>>>>>>>> process in
>>>>>>>>>>> the HbDataStore.initializeDataStore method?
>>>>>>>>>>>
>>>>>>>>>>> Which version of Teneo are you using?
>>>>>>>>>>>
>>>>>>>>>>> gr. Martin
>>>>>>>>>>>
>>>>>>>>>>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>>
>>>>>>>>>>>> I have the same problem and tried to debug into the setTuplizer
>>>>>>>>>>>> method.
>>>>>>>>>>>>
>>>>>>>>>>>> I.e. I
>>>>>>>>>>>> - started jboss 5.1
>>>>>>>>>>>> - started remote eclipse debugging session
>>>>>>>>>>>> - set a breakpoint at HbDataStore.setTuplizer()
>>>>>>>>>>>> - redeployed my package into default/deploy
>>>>>>>>>>>>
>>>>>>>>>>>> As my eclipse doesn't start to blink and I don't see the
>>>>>>>>>>>> debugger
>>>>>>>>>>>> activated the breakpoint I assume the
>>>>>>>>>>>> HbDataStore.setTuplizer is
>>>>>>>>>>>> not
>>>>>>>>>>>> called.
>>>>>>>>>>>>
>>>>>>>>>>>> Do you (or somebody else) have a solution please?
>>>>>>>>>>>>
>>>>>>>>>>>> Thank you
>>>>>>>>>>>> Daniel
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>>>>>>>>>>> Hi Ajay,
>>>>>>>>>>>>> It does not seem to use the EMFTuplizer but the standard
>>>>>>>>>>>>> PojoEntityTuplizer:
>>>>>>>>>>>>>
>>>>>>>>>>>>> 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)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> The tuplizer creates the accessors (setters/getters) used by
>>>>>>>>>>>>> Hibernate.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Can you check/debug if the HbDataStore.setTuplizer() is called
>>>>>>>>>>>>> and
>>>>>>>>>>>>> what
>>>>>>>>>>>>> it does?
>>>>>>>>>>>>>
>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>
>>>>>>>>>>>>> Ajay Chauhan wrote:
>>>>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I am using two EMF classes and two DAOs (one for Employee and
>>>>>>>>>>>>>> other
>>>>>>>>>>>>>> one for EmailAddresses) for performimg operations on EMF
>>>>>>>>>>>>>> objects.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Testcases for both Employee and EmailAddresses are working
>>>>>>>>>>>>>> fine
>>>>>>>>>>>>>> with
>>>>>>>>>>>>>> Teneo1.0.1 libraries but asking "setters" for EList type
>>>>>>>>>>>>>> attributes
>>>>>>>>>>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> The generated interfaces are as follows:
>>>>>>>>>>>>>> 1.EmailAddresses
>>>>>>>>>>>>>> 2.Employee
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> The generated implementation classes are as follows:
>>>>>>>>>>>>>> 1.EmailAddressesImpl
>>>>>>>>>>>>>> 2.EmployeeImpl
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Two DAOs:
>>>>>>>>>>>>>> 1. DAO_Employee
>>>>>>>>>>>>>> 2. DAO_EmailAddress
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> The association between Employee and EmailAddresses is a
>>>>>>>>>>>>>> bidirectional
>>>>>>>>>>>>>> one-to-many relationship.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I am pasting complete Hbm file, Test class and Exception Log
>>>>>>>>>>>>>> for
>>>>>>>>>>>>>> your
>>>>>>>>>>>>>> perusal.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hbm for these two classes are listed below:
>>>>>>>>>>>>>> **************************************************
>>>>>>>>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>>>>>>>>> <!-- Hibernate XML Mapping File -->
>>>>>>>>>>>>>> <!-- Author: U129098 -->
>>>>>>>>>>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>>>>>>>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>>>>>>>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>>>>>>>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>>>>>>>>>>> <hibernate-mapping auto-import="true">
>>>>>>>>>>>>>> <class
>>>>>>>>>>>>>> name="com.person.impl.EmployeeImpl"
>>>>>>>>>>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>>>>> dynamic-insert="false" select-before-update="false"
>>>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>>>> abstract="false">
>>>>>>>>>>>>>> <id name="personId" column="employee_id">
>>>>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>>>>> </id>
>>>>>>>>>>>>>> <property name="name" insert="true" update="true"
>>>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>>>> optimistic-lock="true" not-null="true">
>>>>>>>>>>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>>>>>>>>>>> </property>
>>>>>>>>>>>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>>>>>>>>>>>> fetch="select" cascade="all" inverse="true">
>>>>>>>>>>>>>> <key column="owner_id" />
>>>>>>>>>>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>>>>> entity-name="EmailAddresses" /> </bag>
>>>>>>>>>>>>>> </class>
>>>>>>>>>>>>>> <class
>>>>>>>>>>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>>>>> table="email_address" entity-name="EmailAddresses"
>>>>>>>>>>>>>> mutable="true"
>>>>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>>>>> dynamic-insert="false" select-before-update="false"
>>>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>>>> abstract="false">
>>>>>>>>>>>>>> <id name="emailId" column="email_id">
>>>>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>>>>> </id>
>>>>>>>>>>>>>> <property name="emailAddress" insert="true" update="true"
>>>>>>>>>>>>>> lazy="false" optimistic-lock="true">
>>>>>>>>>>>>>> <column name="email_address" sql-type="varchar"
>>>>>>>>>>>>>> not-null="true" />
>>>>>>>>>>>>>> </property>
>>>>>>>>>>>>>> <many-to-one name="owner" column="owner_id"
>>>>>>>>>>>>>> not-null="true"
>>>>>>>>>>>>>> class="com.person.impl.EmployeeImpl"
>>>>>>>>>>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>>>>>>>>>>> </class>
>>>>>>>>>>>>>> </hibernate-mapping>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> **************************************************
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> TestClass for Employee class:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ***************************************************
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public class EmployeeMappingTest {
>>>>>>>>>>>>>> protected static final String CONTEXT_FILE_NAME =
>>>>>>>>>>>>>> "spring.xml";
>>>>>>>>>>>>>> protected static final ConfigurableApplicationContext
>>>>>>>>>>>>>> springContext =
>>>>>>>>>>>>>> new ClassPathXmlApplicationContext(
>>>>>>>>>>>>>> CONTEXT_FILE_NAME);
>>>>>>>>>>>>>> DAO_Employee employeeDAO = null;
>>>>>>>>>>>>>> SessionFactory sessionFactory = null;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> /**
>>>>>>>>>>>>>> * SetUp method
>>>>>>>>>>>>>> */
>>>>>>>>>>>>>> @Before
>>>>>>>>>>>>>> public void setUp() throws Exception {
>>>>>>>>>>>>>> employeeDAO = (DAO_Employee)
>>>>>>>>>>>>>> springContext.getBean("employeeDAO");
>>>>>>>>>>>>>> sessionFactory = (SessionFactory) springContext
>>>>>>>>>>>>>> .getBean("sessionFactory");
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> @After
>>>>>>>>>>>>>> public void tearDown() throws Exception {
>>>>>>>>>>>>>> employeeDAO = null;
>>>>>>>>>>>>>> sessionFactory = null;
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> /**
>>>>>>>>>>>>>> * Test method for saving an Employee object
>>>>>>>>>>>>>> */
>>>>>>>>>>>>>> @Test
>>>>>>>>>>>>>> public void testSaveEmployee() {
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Employee employee = new EmployeeImpl();
>>>>>>>>>>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>>>>>>>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>>>>>>>>>>> emailAddress.setOwner(employee);
>>>>>>>>>>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>>>>>>>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>>>>>>>>>>> emailAddress1.setOwner(employee);
>>>>>>>>>>>>>> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
>>>>>>>>>>>>>> eList.add(emailAddress);
>>>>>>>>>>>>>> eList.add(emailAddress1);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> employee.setName("Ajay Chauhan");
>>>>>>>>>>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> try {
>>>>>>>>>>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>>>>> employeeDAO.save(employee);
>>>>>>>>>>>>>> tx.commit();
>>>>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>>>>> } }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> /**
>>>>>>>>>>>>>> * Test method for Load
>>>>>>>>>>>>>> */
>>>>>>>>>>>>>> @Test
>>>>>>>>>>>>>> public void testLoadByIdID_Employee() {
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> // set the existing id
>>>>>>>>>>>>>> Integer id = 1;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Employee obj = null;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> try {
>>>>>>>>>>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>>>>> obj = (Employee)
>>>>>>>>>>>>>> sessionFactory.getCurrentSession().get("Employee",id,
>>>>>>>>>>>>>> LockMode.READ);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>>>>>>>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>>>>>>>>>>> for (EmailAddresses email : eList) {
>>>>>>>>>>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>>>>>>>>>>> System.out.println("Email Address :: "
>>>>>>>>>>>>>> + email.getEmailAddress());
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>> txn.commit();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>> *********************************************************
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Exceptions are:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> **********************************************************
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> log4j:WARN No appenders could be found for logger
>>>>>>>>>>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at
>>>>>>>>>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 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:
>>>>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>>>>>>> Error creating bean with name 'employeeDAO' defined in class
>>>>>>>>>>>>>> path
>>>>>>>>>>>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>>>>>>>>>>>> 'employeeSessionFactory' while setting bean property
>>>>>>>>>>>>>> 'sessionFactory';
>>>>>>>>>>>>>> nested exception is
>>>>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>>>>>>> Error
>>>>>>>>>>>>>> creating bean with name 'employeeHbSessionDataStore'
>>>>>>>>>>>>>> defined in
>>>>>>>>>>>>>> class
>>>>>>>>>>>>>> path resource [spring.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.person.teneo.
>>>>>>>>>>>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> threw exception; nested exception is
>>>>>>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a
>>>>>>>>>>>>>> setter
>>>>>>>>>>>>>> for
>>>>>>>>>>>>>> property emailAddresses in class com.person.impl.EmployeeImpl
>>>>>>>>>>>>>> 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)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #637594 is a reply to message #637591] |
Sun, 07 November 2010 13:05 |
Daniel Messages: 16 Registered: June 2010 |
Junior Member |
|
|
The server is currently down.
Daniel
Am 07.11.2010 13:31, schrieb Martin Taal:
> Hi Daniel,
> The link gives me a 404/can't connect with the browser, can you check if
> it is correct?
>
> I am not sure if this could be the problem, the HbSessionDataStore is
> just a wrapper around the internal SessionFactory, most testcases of
> Teneo uses the SessionFactory provided by the HbSessionDataStore
> directly.So going through the HbSessionDataStore api or directly to its
> SessionFactory does not make a difference afaicu.
>
> gr. Martin
>
> On 11/07/2010 12:34 PM, Daniel Winz wrote:
>> Hi Martin,
>>
>> thank you very much for the hints. I will consider using texo next.
>>
>> But at the moment, unfortunately, I am a little fixated on teneo. I
>> can't give in yet.
>>
>> Meanwhile I read Sebastian Tomschke's blog
>> ( http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-s pring-transactions-opensessioninviewfilter/lang/de/)
>>
>> that describes a problem concerning the Hibernate SessionFactory: "The
>> HibernateTransactionManager does NOT get the
>> teneoSessionFactory(HbSessionDataStore) object passed in as
>> sessionFactory, but the underlying Hibernate SessionFactory that can be
>> retrieved from the HbSessionDataStore via the getSessionFactory()
>> method. Not doing so will result in duplicate Hibernate Sessions
>> completely breaking the transaction managment." (Tomschke)
>>
>> Regarding your assumption I am wondering if I am facing the same problem
>> described by Tomschke.
>>
>>
>> Kindly
>> Daniel
>>
>>
>>
>> Am 02.11.2010 19:40, schrieb Martin Taal:
>>> Hi Daniel,
>>> As a default the mapping is generated in memory, you can see the mapping
>>> by doing dataStore.getMappingXML(). My feel is that the sessionfactory
>>> used at runtime is not created/provided by the DataStore but by some
>>> other means.
>>>
>>> As a totally other solution, did I already mention the Texo project for
>>> you:
>>> http://wiki.eclipse.org/Texo
>>>
>>> It generates true pojos and the ORM with nice EMF-like features as
>>> XML/XMI persistence and a runtime model. The good thing is that you
>>> don't need a runtime layer like Teneo, the generated code/orm works out
>>> of the box with Hibernate/EclipseLink.
>>>
>>> gr. Martin
>>>
>>> On 11/02/2010 05:40 PM, Daniel Winz wrote:
>>>> Hello
>>>>
>>>> unfortunately on deployment of my package I still get the exception:
>>>>
>>>> ***********
>>>> 2010-11-02 17:02:19,051 ERROR
>>>> [org.jboss.kernel.plugins.dependency.AbstractKernelControlle r]
>>>> (HDScanner) Error installing to Start:
>>>> name=jboss.test.har:service=Hibernate,testcase=TimersUnitTes tCase
>>>> state=Create
>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>> property project in class timetracker.impl.OperatorImpl
>>>> 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)
>>>>
>>>>
>>>>
>>>>
>>>> ************
>>>>
>>>> I am new to teneo and maybe my understanding is totally wrong. But I am
>>>> wondering if ...
>>>>
>>>> I have to configure something on server-side to enable the teneo
>>>> tuplizer? I copied all teneo libraries to the jboss default/lib folder.
>>>>
>>>> Or is something wrong with my package ear configuration? But my test at
>>>> eclipse worked fine. All tables on mysql-db were created .. ?!
>>>>
>>>> I downloaded the "org.eclipse.emf.teneo.hibernate.examples" example but
>>>> it doesn't contain any persistence or hibernate-configuration but
>>>> annotations.xml. I am a little confused about that.
>>>>
>>>> Do you know an introduction especially for jboss and hibernate-mapping
>>>> file?
>>>>
>>>>
>>>> Thank you
>>>> Daniel
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Am 02.11.2010 09:55, schrieb Daniel Winz:
>>>>> Hi,
>>>>>
>>>>> sorry, I had some class not found exeptions.
>>>>>
>>>>> I missed and added following classes:
>>>>>
>>>>> -org/dom4j/DocumentException, added dom4j-1.6.1.jar
>>>>> -org/slf4j/LoggerFactory, added slf4j-api-1.5.8.jar
>>>>> -org/apache/log4j/Level, added log4j.jar
>>>>> -jdbc driver
>>>>> -org/apache/commons/collections/map/LRUMap, added
>>>>> commons-collection.jar
>>>>> -javax/transaction/Synchronization, jboss-j2ee.jar
>>>>>
>>>>> Now my example runs through and the debugger steps into
>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataSt ore().
>>>>>
>>>>>
>>>>> No class not found exeptions at my server.
>>>>>
>>>>>
>>>>>
>>>>> Daniel
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Am 01.11.2010 20:41, schrieb Martin Taal:
>>>>>> hmm, it sounds like that an exception occured, are you catching an
>>>>>> exception somewhere maybe?
>>>>>> For the rest I am kind of puzzled why debugging does not work as
>>>>>> expected...
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> On 11/01/2010 06:50 PM, Daniel Winz wrote:
>>>>>>> The debugger gets off before at getConfiguration() and jumps into
>>>>>>> the
>>>>>>> finally sequence. hbConfiguration = null.
>>>>>>>
>>>>>>> I tried to place the service-hibernate.xml that contains
>>>>>>> hibernate-configuration at src and src/META-INF. But same result.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Daniel
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Am 01.11.2010 17:09, schrieb Martin Taal:
>>>>>>>> Hi Daniel,
>>>>>>>> Inside the HbSessionDataStore.initialize method there is the
>>>>>>>> call to
>>>>>>>> initializeDataStore, what happens if you debug to that call and
>>>>>>>> into
>>>>>>>> it?
>>>>>>>>
>>>>>>>> gr. Martin
>>>>>>>>
>>>>>>>> On 11/01/2010 04:48 PM, Daniel Winz wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>> Hi Martin,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> the debugger doesn't stop at the breakpoint at
>>>>>>>>> initializeDataStore().
>>>>>>>>> Instead it runs into HbSessionDataStore.initialize().
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Breakpoint at initializeDataStore()
>>>>>>>>> ***************************
>>>>>>>>> protected void initializeDataStore() {
>>>>>>>>> // buildmappings has to be done before setting the tuplizers
>>>>>>>>> because
>>>>>>>>> // buildMappings will ensure that the element
>>>>>>>>> // is set in the List properties.
>>>>>>>>> BP: buildMappings();
>>>>>>>>>
>>>>>>>>> setInterceptor();
>>>>>>>>> ***************************
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> My testcode:
>>>>>>>>> ***********
>>>>>>>>> public static void main(String[] args) {
>>>>>>>>>
>>>>>>>>> HbDataStore hbds =
>>>>>>>>> (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb ");
>>>>>>>>>
>>>>>>>>> final Properties props = new Properties();
>>>>>>>>> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
>>>>>>>>> props.setProperty(Environment.URL,
>>>>>>>>> "jdbc:mysql://127.0.0.1:3306/timetracker");
>>>>>>>>> props.setProperty(Environment.USER, "root");
>>>>>>>>> props.setProperty(Environment.PASS, "root");
>>>>>>>>> props.setProperty(Environment.DIALECT,
>>>>>>>>> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
>>>>>>>>> props.setProperty(Environment.SHOW_SQL, "true");
>>>>>>>>>
>>>>>>>>> props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_C ONTAINMENT,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> "REFRESH,PERSIST,MERGE");
>>>>>>>>>
>>>>>>>>> hbds.setProperties(props);
>>>>>>>>>
>>>>>>>>> hbds.setEPackages(new EPackage[]{TimetrackerPackage.eINSTANCE});
>>>>>>>>> hbds.initialize();
>>>>>>>>> ************
>>>>>>>>>
>>>>>>>>> ???
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Am 01.11.2010 15:18, schrieb Martin Taal:
>>>>>>>>>> Can you check if the debugger stops in your own code where
>>>>>>>>>> dataStore.initialize is called?
>>>>>>>>>>
>>>>>>>>>> gr. Martin
>>>>>>>>>>
>>>>>>>>>> On 11/01/2010 11:52 AM, Daniel Winz wrote:
>>>>>>>>>>> Teneo Version: 1.1.2.v201009161849
>>>>>>>>>>>
>>>>>>>>>>> The debugger doesn't stop at HbDataStore.initializeDataStore.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Daniel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Am 01.11.2010 11:16, schrieb Martin Taal:
>>>>>>>>>>>> Hi Daniel,
>>>>>>>>>>>> Hmm, it remains a strange thing as the setTuplizer is called
>>>>>>>>>>>> from
>>>>>>>>>>>> initialize. Can you set the breakpoint a bit earlier in the
>>>>>>>>>>>> process in
>>>>>>>>>>>> the HbDataStore.initializeDataStore method?
>>>>>>>>>>>>
>>>>>>>>>>>> Which version of Teneo are you using?
>>>>>>>>>>>>
>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>
>>>>>>>>>>>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I have the same problem and tried to debug into the
>>>>>>>>>>>>> setTuplizer
>>>>>>>>>>>>> method.
>>>>>>>>>>>>>
>>>>>>>>>>>>> I.e. I
>>>>>>>>>>>>> - started jboss 5.1
>>>>>>>>>>>>> - started remote eclipse debugging session
>>>>>>>>>>>>> - set a breakpoint at HbDataStore.setTuplizer()
>>>>>>>>>>>>> - redeployed my package into default/deploy
>>>>>>>>>>>>>
>>>>>>>>>>>>> As my eclipse doesn't start to blink and I don't see the
>>>>>>>>>>>>> debugger
>>>>>>>>>>>>> activated the breakpoint I assume the
>>>>>>>>>>>>> HbDataStore.setTuplizer is
>>>>>>>>>>>>> not
>>>>>>>>>>>>> called.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Do you (or somebody else) have a solution please?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thank you
>>>>>>>>>>>>> Daniel
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>>>>>>>>>>>> Hi Ajay,
>>>>>>>>>>>>>> It does not seem to use the EMFTuplizer but the standard
>>>>>>>>>>>>>> PojoEntityTuplizer:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 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)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> The tuplizer creates the accessors (setters/getters) used by
>>>>>>>>>>>>>> Hibernate.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Can you check/debug if the HbDataStore.setTuplizer() is
>>>>>>>>>>>>>> called
>>>>>>>>>>>>>> and
>>>>>>>>>>>>>> what
>>>>>>>>>>>>>> it does?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Ajay Chauhan wrote:
>>>>>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I am using two EMF classes and two DAOs (one for Employee
>>>>>>>>>>>>>>> and
>>>>>>>>>>>>>>> other
>>>>>>>>>>>>>>> one for EmailAddresses) for performimg operations on EMF
>>>>>>>>>>>>>>> objects.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Testcases for both Employee and EmailAddresses are working
>>>>>>>>>>>>>>> fine
>>>>>>>>>>>>>>> with
>>>>>>>>>>>>>>> Teneo1.0.1 libraries but asking "setters" for EList type
>>>>>>>>>>>>>>> attributes
>>>>>>>>>>>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> The generated interfaces are as follows:
>>>>>>>>>>>>>>> 1.EmailAddresses
>>>>>>>>>>>>>>> 2.Employee
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> The generated implementation classes are as follows:
>>>>>>>>>>>>>>> 1.EmailAddressesImpl
>>>>>>>>>>>>>>> 2.EmployeeImpl
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Two DAOs:
>>>>>>>>>>>>>>> 1. DAO_Employee
>>>>>>>>>>>>>>> 2. DAO_EmailAddress
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> The association between Employee and EmailAddresses is a
>>>>>>>>>>>>>>> bidirectional
>>>>>>>>>>>>>>> one-to-many relationship.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I am pasting complete Hbm file, Test class and Exception Log
>>>>>>>>>>>>>>> for
>>>>>>>>>>>>>>> your
>>>>>>>>>>>>>>> perusal.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Hbm for these two classes are listed below:
>>>>>>>>>>>>>>> **************************************************
>>>>>>>>>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>>>>>>>>>> <!-- Hibernate XML Mapping File -->
>>>>>>>>>>>>>>> <!-- Author: U129098 -->
>>>>>>>>>>>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>>>>>>>>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>>>>>>>>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>>>>>>>>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> <hibernate-mapping auto-import="true">
>>>>>>>>>>>>>>> <class
>>>>>>>>>>>>>>> name="com.person.impl.EmployeeImpl"
>>>>>>>>>>>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>>>>>> dynamic-insert="false" select-before-update="false"
>>>>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>>>>> abstract="false">
>>>>>>>>>>>>>>> <id name="personId" column="employee_id">
>>>>>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>>>>>> </id>
>>>>>>>>>>>>>>> <property name="name" insert="true" update="true"
>>>>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>>>>> optimistic-lock="true" not-null="true">
>>>>>>>>>>>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>>>>>>>>>>>> </property>
>>>>>>>>>>>>>>> <bag name="emailAddresses" lazy="true" table="email_address"
>>>>>>>>>>>>>>> fetch="select" cascade="all" inverse="true">
>>>>>>>>>>>>>>> <key column="owner_id" />
>>>>>>>>>>>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>>>>>> entity-name="EmailAddresses" /> </bag>
>>>>>>>>>>>>>>> </class>
>>>>>>>>>>>>>>> <class
>>>>>>>>>>>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>>>>>> table="email_address" entity-name="EmailAddresses"
>>>>>>>>>>>>>>> mutable="true"
>>>>>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>>>>>> dynamic-insert="false" select-before-update="false"
>>>>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>>>>> abstract="false">
>>>>>>>>>>>>>>> <id name="emailId" column="email_id">
>>>>>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>>>>>> </id>
>>>>>>>>>>>>>>> <property name="emailAddress" insert="true" update="true"
>>>>>>>>>>>>>>> lazy="false" optimistic-lock="true">
>>>>>>>>>>>>>>> <column name="email_address" sql-type="varchar"
>>>>>>>>>>>>>>> not-null="true" />
>>>>>>>>>>>>>>> </property>
>>>>>>>>>>>>>>> <many-to-one name="owner" column="owner_id"
>>>>>>>>>>>>>>> not-null="true"
>>>>>>>>>>>>>>> class="com.person.impl.EmployeeImpl"
>>>>>>>>>>>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>>>>>>>>>>>> </class>
>>>>>>>>>>>>>>> </hibernate-mapping>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> **************************************************
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> TestClass for Employee class:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ***************************************************
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> public class EmployeeMappingTest {
>>>>>>>>>>>>>>> protected static final String CONTEXT_FILE_NAME =
>>>>>>>>>>>>>>> "spring.xml";
>>>>>>>>>>>>>>> protected static final ConfigurableApplicationContext
>>>>>>>>>>>>>>> springContext =
>>>>>>>>>>>>>>> new ClassPathXmlApplicationContext(
>>>>>>>>>>>>>>> CONTEXT_FILE_NAME);
>>>>>>>>>>>>>>> DAO_Employee employeeDAO = null;
>>>>>>>>>>>>>>> SessionFactory sessionFactory = null;
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> /**
>>>>>>>>>>>>>>> * SetUp method
>>>>>>>>>>>>>>> */
>>>>>>>>>>>>>>> @Before
>>>>>>>>>>>>>>> public void setUp() throws Exception {
>>>>>>>>>>>>>>> employeeDAO = (DAO_Employee)
>>>>>>>>>>>>>>> springContext.getBean("employeeDAO");
>>>>>>>>>>>>>>> sessionFactory = (SessionFactory) springContext
>>>>>>>>>>>>>>> .getBean("sessionFactory");
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> @After
>>>>>>>>>>>>>>> public void tearDown() throws Exception {
>>>>>>>>>>>>>>> employeeDAO = null;
>>>>>>>>>>>>>>> sessionFactory = null;
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> /**
>>>>>>>>>>>>>>> * Test method for saving an Employee object
>>>>>>>>>>>>>>> */
>>>>>>>>>>>>>>> @Test
>>>>>>>>>>>>>>> public void testSaveEmployee() {
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Employee employee = new EmployeeImpl();
>>>>>>>>>>>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>>>>>>>>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>>>>>>>>>>>> emailAddress.setOwner(employee);
>>>>>>>>>>>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>>>>>>>>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>>>>>>>>>>>> emailAddress1.setOwner(employee);
>>>>>>>>>>>>>>> List<EmailAddresses> eList = new
>>>>>>>>>>>>>>> ArrayList<EmailAddresses>();
>>>>>>>>>>>>>>> eList.add(emailAddress);
>>>>>>>>>>>>>>> eList.add(emailAddress1);
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> employee.setName("Ajay Chauhan");
>>>>>>>>>>>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> try {
>>>>>>>>>>>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>>>>>> employeeDAO.save(employee);
>>>>>>>>>>>>>>> tx.commit();
>>>>>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>>>>>> } }
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> /**
>>>>>>>>>>>>>>> * Test method for Load
>>>>>>>>>>>>>>> */
>>>>>>>>>>>>>>> @Test
>>>>>>>>>>>>>>> public void testLoadByIdID_Employee() {
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> // set the existing id
>>>>>>>>>>>>>>> Integer id = 1;
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Employee obj = null;
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> try {
>>>>>>>>>>>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>>>>>> obj = (Employee)
>>>>>>>>>>>>>>> sessionFactory.getCurrentSession().get("Employee",id,
>>>>>>>>>>>>>>> LockMode.READ);
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>>>>>>>>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>>>>>>>>>>>> for (EmailAddresses email : eList) {
>>>>>>>>>>>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>>>>>>>>>>>> System.out.println("Email Address :: "
>>>>>>>>>>>>>>> + email.getEmailAddress());
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>> txn.commit();
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>> *********************************************************
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Exceptions are:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> **********************************************************
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> log4j:WARN No appenders could be found for logger
>>>>>>>>>>>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> at
>>>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> at
>>>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> at
>>>>>>>>>>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> at
>>>>>>>>>>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> at
>>>>>>>>>>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> 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:
>>>>>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>>>>>>>> Error creating bean with name 'employeeDAO' defined in class
>>>>>>>>>>>>>>> path
>>>>>>>>>>>>>>> resource [spring.xml]: Cannot resolve reference to bean
>>>>>>>>>>>>>>> 'employeeSessionFactory' while setting bean property
>>>>>>>>>>>>>>> 'sessionFactory';
>>>>>>>>>>>>>>> nested exception is
>>>>>>>>>>>>>>> org.springframework.beans.factory.BeanCreationException:
>>>>>>>>>>>>>>> Error
>>>>>>>>>>>>>>> creating bean with name 'employeeHbSessionDataStore'
>>>>>>>>>>>>>>> defined in
>>>>>>>>>>>>>>> class
>>>>>>>>>>>>>>> path resource [spring.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.person.teneo.
>>>>>>>>>>>>>>> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> threw exception; nested exception is
>>>>>>>>>>>>>>> org.hibernate.PropertyNotFoundException: Could not find a
>>>>>>>>>>>>>>> setter
>>>>>>>>>>>>>>> for
>>>>>>>>>>>>>>> property emailAddresses in class
>>>>>>>>>>>>>>> com.person.impl.EmployeeImpl
>>>>>>>>>>>>>>> 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)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>&g
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #637614 is a reply to message #637594] |
Sun, 07 November 2010 21:01 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
It is up, an interesting blog, but I am not sure if that's your problem, both the teneo datastore as well as its
internal sessionfactory will have the tuplizer set.
But maybe it is related that if the sessionfactory is not found or something that another sessionfactory is used (in
guessing mode here...).
gr. Martin
On 11/07/2010 02:05 PM, Daniel Winz wrote:
> The server is currently down.
>
> Daniel
>
>
> Am 07.11.2010 13:31, schrieb Martin Taal:
>> Hi Daniel,
>> The link gives me a 404/can't connect with the browser, can you check if
>> it is correct?
>>
>> I am not sure if this could be the problem, the HbSessionDataStore is
>> just a wrapper around the internal SessionFactory, most testcases of
>> Teneo uses the SessionFactory provided by the HbSessionDataStore
>> directly.So going through the HbSessionDataStore api or directly to its
>> SessionFactory does not make a difference afaicu.
>>
>> gr. Martin
>>
>> On 11/07/2010 12:34 PM, Daniel Winz wrote:
>>> Hi Martin,
>>>
>>> thank you very much for the hints. I will consider using texo next.
>>>
>>> But at the moment, unfortunately, I am a little fixated on teneo. I
>>> can't give in yet.
>>>
>>> Meanwhile I read Sebastian Tomschke's blog
>>> ( http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-s pring-transactions-opensessioninviewfilter/lang/de/)
>>>
>>>
>>> that describes a problem concerning the Hibernate SessionFactory: "The
>>> HibernateTransactionManager does NOT get the
>>> teneoSessionFactory(HbSessionDataStore) object passed in as
>>> sessionFactory, but the underlying Hibernate SessionFactory that can be
>>> retrieved from the HbSessionDataStore via the getSessionFactory()
>>> method. Not doing so will result in duplicate Hibernate Sessions
>>> completely breaking the transaction managment." (Tomschke)
>>>
>>> Regarding your assumption I am wondering if I am facing the same problem
>>> described by Tomschke.
>>>
>>>
>>> Kindly
>>> Daniel
>>>
>>>
>>>
>>> Am 02.11.2010 19:40, schrieb Martin Taal:
>>>> Hi Daniel,
>>>> As a default the mapping is generated in memory, you can see the
>>>> mapping
>>>> by doing dataStore.getMappingXML(). My feel is that the sessionfactory
>>>> used at runtime is not created/provided by the DataStore but by some
>>>> other means.
>>>>
>>>> As a totally other solution, did I already mention the Texo project for
>>>> you:
>>>> http://wiki.eclipse.org/Texo
>>>>
>>>> It generates true pojos and the ORM with nice EMF-like features as
>>>> XML/XMI persistence and a runtime model. The good thing is that you
>>>> don't need a runtime layer like Teneo, the generated code/orm works out
>>>> of the box with Hibernate/EclipseLink.
>>>>
>>>> gr. Martin
>>>>
>>>> On 11/02/2010 05:40 PM, Daniel Winz wrote:
>>>>> Hello
>>>>>
>>>>> unfortunately on deployment of my package I still get the exception:
>>>>>
>>>>> ***********
>>>>> 2010-11-02 17:02:19,051 ERROR
>>>>> [org.jboss.kernel.plugins.dependency.AbstractKernelControlle r]
>>>>> (HDScanner) Error installing to Start:
>>>>> name=jboss.test.har:service=Hibernate,testcase=TimersUnitTes tCase
>>>>> state=Create
>>>>> org.hibernate.PropertyNotFoundException: Could not find a setter for
>>>>> property project in class timetracker.impl.OperatorImpl
>>>>> 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)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ************
>>>>>
>>>>> I am new to teneo and maybe my understanding is totally wrong. But
>>>>> I am
>>>>> wondering if ...
>>>>>
>>>>> I have to configure something on server-side to enable the teneo
>>>>> tuplizer? I copied all teneo libraries to the jboss default/lib
>>>>> folder.
>>>>>
>>>>> Or is something wrong with my package ear configuration? But my
>>>>> test at
>>>>> eclipse worked fine. All tables on mysql-db were created .. ?!
>>>>>
>>>>> I downloaded the "org.eclipse.emf.teneo.hibernate.examples" example
>>>>> but
>>>>> it doesn't contain any persistence or hibernate-configuration but
>>>>> annotations.xml. I am a little confused about that.
>>>>>
>>>>> Do you know an introduction especially for jboss and hibernate-mapping
>>>>> file?
>>>>>
>>>>>
>>>>> Thank you
>>>>> Daniel
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Am 02.11.2010 09:55, schrieb Daniel Winz:
>>>>>> Hi,
>>>>>>
>>>>>> sorry, I had some class not found exeptions.
>>>>>>
>>>>>> I missed and added following classes:
>>>>>>
>>>>>> -org/dom4j/DocumentException, added dom4j-1.6.1.jar
>>>>>> -org/slf4j/LoggerFactory, added slf4j-api-1.5.8.jar
>>>>>> -org/apache/log4j/Level, added log4j.jar
>>>>>> -jdbc driver
>>>>>> -org/apache/commons/collections/map/LRUMap, added
>>>>>> commons-collection.jar
>>>>>> -javax/transaction/Synchronization, jboss-j2ee.jar
>>>>>>
>>>>>> Now my example runs through and the debugger steps into
>>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataSt ore().
>>>>>>
>>>>>>
>>>>>> No class not found exeptions at my server.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Daniel
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 01.11.2010 20:41, schrieb Martin Taal:
>>>>>>> hmm, it sounds like that an exception occured, are you catching an
>>>>>>> exception somewhere maybe?
>>>>>>> For the rest I am kind of puzzled why debugging does not work as
>>>>>>> expected...
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> On 11/01/2010 06:50 PM, Daniel Winz wrote:
>>>>>>>> The debugger gets off before at getConfiguration() and jumps into
>>>>>>>> the
>>>>>>>> finally sequence. hbConfiguration = null.
>>>>>>>>
>>>>>>>> I tried to place the service-hibernate.xml that contains
>>>>>>>> hibernate-configuration at src and src/META-INF. But same result.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Daniel
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 01.11.2010 17:09, schrieb Martin Taal:
>>>>>>>>> Hi Daniel,
>>>>>>>>> Inside the HbSessionDataStore.initialize method there is the
>>>>>>>>> call to
>>>>>>>>> initializeDataStore, what happens if you debug to that call and
>>>>>>>>> into
>>>>>>>>> it?
>>>>>>>>>
>>>>>>>>> gr. Martin
>>>>>>>>>
>>>>>>>>> On 11/01/2010 04:48 PM, Daniel Winz wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Hi Martin,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> the debugger doesn't stop at the breakpoint at
>>>>>>>>>> initializeDataStore().
>>>>>>>>>> Instead it runs into HbSessionDataStore.initialize().
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Breakpoint at initializeDataStore()
>>>>>>>>>> ***************************
>>>>>>>>>> protected void initializeDataStore() {
>>>>>>>>>> // buildmappings has to be done before setting the tuplizers
>>>>>>>>>> because
>>>>>>>>>> // buildMappings will ensure that the element
>>>>>>>>>> // is set in the List properties.
>>>>>>>>>> BP: buildMappings();
>>>>>>>>>>
>>>>>>>>>> setInterceptor();
>>>>>>>>>> ***************************
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> My testcode:
>>>>>>>>>> ***********
>>>>>>>>>> public static void main(String[] args) {
>>>>>>>>>>
>>>>>>>>>> HbDataStore hbds =
>>>>>>>>>> (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb ");
>>>>>>>>>>
>>>>>>>>>> final Properties props = new Properties();
>>>>>>>>>> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
>>>>>>>>>> props.setProperty(Environment.URL,
>>>>>>>>>> "jdbc:mysql://127.0.0.1:3306/timetracker");
>>>>>>>>>> props.setProperty(Environment.USER, "root");
>>>>>>>>>> props.setProperty(Environment.PASS, "root");
>>>>>>>>>> props.setProperty(Environment.DIALECT,
>>>>>>>>>> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
>>>>>>>>>> props.setProperty(Environment.SHOW_SQL, "true");
>>>>>>>>>>
>>>>>>>>>> props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_C ONTAINMENT,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> "REFRESH,PERSIST,MERGE");
>>>>>>>>>>
>>>>>>>>>> hbds.setProperties(props);
>>>>>>>>>>
>>>>>>>>>> hbds.setEPackages(new EPackage[]{TimetrackerPackage.eINSTANCE});
>>>>>>>>>> hbds.initialize();
>>>>>>>>>> ************
>>>>>>>>>>
>>>>>>>>>> ???
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Am 01.11.2010 15:18, schrieb Martin Taal:
>>>>>>>>>>> Can you check if the debugger stops in your own code where
>>>>>>>>>>> dataStore.initialize is called?
>>>>>>>>>>>
>>>>>>>>>>> gr. Martin
>>>>>>>>>>>
>>>>>>>>>>> On 11/01/2010 11:52 AM, Daniel Winz wrote:
>>>>>>>>>>>> Teneo Version: 1.1.2.v201009161849
>>>>>>>>>>>>
>>>>>>>>>>>> The debugger doesn't stop at HbDataStore.initializeDataStore.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Daniel
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Am 01.11.2010 11:16, schrieb Martin Taal:
>>>>>>>>>>>>> Hi Daniel,
>>>>>>>>>>>>> Hmm, it remains a strange thing as the setTuplizer is called
>>>>>>>>>>>>> from
>>>>>>>>>>>>> initialize. Can you set the breakpoint a bit earlier in the
>>>>>>>>>>>>> process in
>>>>>>>>>>>>> the HbDataStore.initializeDataStore method?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Which version of Teneo are you using?
>>>>>>>>>>>>>
>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 11/01/2010 11:00 AM, Daniel Winz wrote:
>>>>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I have the same problem and tried to debug into the
>>>>>>>>>>>>>> setTuplizer
>>>>>>>>>>>>>> method.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I.e. I
>>>>>>>>>>>>>> - started jboss 5.1
>>>>>>>>>>>>>> - started remote eclipse debugging session
>>>>>>>>>>>>>> - set a breakpoint at HbDataStore.setTuplizer()
>>>>>>>>>>>>>> - redeployed my package into default/deploy
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> As my eclipse doesn't start to blink and I don't see the
>>>>>>>>>>>>>> debugger
>>>>>>>>>>>>>> activated the breakpoint I assume the
>>>>>>>>>>>>>> HbDataStore.setTuplizer is
>>>>>>>>>>>>>> not
>>>>>>>>>>>>>> called.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Do you (or somebody else) have a solution please?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thank you
>>>>>>>>>>>>>> Daniel
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Am 10.06.2009 14:05, schrieb Martin Taal:
>>>>>>>>>>>>>>> Hi Ajay,
>>>>>>>>>>>>>>> It does not seem to use the EMFTuplizer but the standard
>>>>>>>>>>>>>>> PojoEntityTuplizer:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> 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)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> The tuplizer creates the accessors (setters/getters) used by
>>>>>>>>>>>>>>> Hibernate.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Can you check/debug if the HbDataStore.setTuplizer() is
>>>>>>>>>>>>>>> called
>>>>>>>>>>>>>>> and
>>>>>>>>>>>>>>> what
>>>>>>>>>>>>>>> it does?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> gr. Martin
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Ajay Chauhan wrote:
>>>>>>>>>>>>>>>> Hello Martin,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> I am using two EMF classes and two DAOs (one for Employee
>>>>>>>>>>>>>>>> and
>>>>>>>>>>>>>>>> other
>>>>>>>>>>>>>>>> one for EmailAddresses) for performimg operations on EMF
>>>>>>>>>>>>>>>> objects.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Testcases for both Employee and EmailAddresses are working
>>>>>>>>>>>>>>>> fine
>>>>>>>>>>>>>>>> with
>>>>>>>>>>>>>>>> Teneo1.0.1 libraries but asking "setters" for EList type
>>>>>>>>>>>>>>>> attributes
>>>>>>>>>>>>>>>> while running test cases using Teneo 1.0.3 libraries.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> The generated interfaces are as follows:
>>>>>>>>>>>>>>>> 1.EmailAddresses
>>>>>>>>>>>>>>>> 2.Employee
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> The generated implementation classes are as follows:
>>>>>>>>>>>>>>>> 1.EmailAddressesImpl
>>>>>>>>>>>>>>>> 2.EmployeeImpl
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Two DAOs:
>>>>>>>>>>>>>>>> 1. DAO_Employee
>>>>>>>>>>>>>>>> 2. DAO_EmailAddress
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> The association between Employee and EmailAddresses is a
>>>>>>>>>>>>>>>> bidirectional
>>>>>>>>>>>>>>>> one-to-many relationship.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> I am pasting complete Hbm file, Test class and Exception
>>>>>>>>>>>>>>>> Log
>>>>>>>>>>>>>>>> for
>>>>>>>>>>>>>>>> your
>>>>>>>>>>>>>>>> perusal.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hbm for these two classes are listed below:
>>>>>>>>>>>>>>>> **************************************************
>>>>>>>>>>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>>>>>>>>>>> <!-- Hibernate XML Mapping File -->
>>>>>>>>>>>>>>>> <!-- Author: U129098 -->
>>>>>>>>>>>>>>>> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
>>>>>>>>>>>>>>>> <!DOCTYPE hibernate-mapping PUBLIC
>>>>>>>>>>>>>>>> "-//Hibernate/Hibernate Mapping DTD//EN"
>>>>>>>>>>>>>>>> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> <hibernate-mapping auto-import="true">
>>>>>>>>>>>>>>>> <class
>>>>>>>>>>>>>>>> name="com.person.impl.EmployeeImpl"
>>>>>>>>>>>>>>>> table="employee" entity-name="Employee" mutable="true"
>>>>>>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>>>>>>> dynamic-insert="false" select-before-update="false"
>>>>>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>>>>>> abstract="false">
>>>>>>>>>>>>>>>> <id name="personId" column="employee_id">
>>>>>>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>>>>>>> </id>
>>>>>>>>>>>>>>>> <property name="name" insert="true" update="true"
>>>>>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>>>>>> optimistic-lock="true" not-null="true">
>>>>>>>>>>>>>>>> <column name="name" sql-type="varchar" not-null="true" />
>>>>>>>>>>>>>>>> </property>
>>>>>>>>>>>>>>>> <bag name="emailAddresses" lazy="true"
>>>>>>>>>>>>>>>> table="email_address"
>>>>>>>>>>>>>>>> fetch="select" cascade="all" inverse="true">
>>>>>>>>>>>>>>>> <key column="owner_id" />
>>>>>>>>>>>>>>>> <one-to-many class="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>>>>>>> entity-name="EmailAddresses" /> </bag>
>>>>>>>>>>>>>>>> </class>
>>>>>>>>>>>>>>>> <class
>>>>>>>>>>>>>>>> name="com.person.impl.EmailAddressesImpl"
>>>>>>>>>>>>>>>> table="email_address" entity-name="EmailAddresses"
>>>>>>>>>>>>>>>> mutable="true"
>>>>>>>>>>>>>>>> dynamic-update="false"
>>>>>>>>>>>>>>>> dynamic-insert="false" select-before-update="false"
>>>>>>>>>>>>>>>> lazy="false"
>>>>>>>>>>>>>>>> abstract="false">
>>>>>>>>>>>>>>>> <id name="emailId" column="email_id">
>>>>>>>>>>>>>>>> <generator class="increment" />
>>>>>>>>>>>>>>>> </id>
>>>>>>>>>>>>>>>> <property name="emailAddress" insert="true" update="true"
>>>>>>>>>>>>>>>> lazy="false" optimistic-lock="true">
>>>>>>>>>>>>>>>> <column name="email_address" sql-type="varchar"
>>>>>>>>>>>>>>>> not-null="true" />
>>>>>>>>>>>>>>>> </property>
>>>>>>>>>>>>>>>> <many-to-one name="owner" column="owner_id"
>>>>>>>>>>>>>>>> not-null="true"
>>>>>>>>>>>>>>>> class="com.person.impl.EmployeeImpl"
>>>>>>>>>>>>>>>> lazy="proxy" entity-name="Employee" cascade="all"/>
>>>>>>>>>>>>>>>> </class>
>>>>>>>>>>>>>>>> </hibernate-mapping>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> **************************************************
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> TestClass for Employee class:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ***************************************************
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> public class EmployeeMappingTest {
>>>>>>>>>>>>>>>> protected static final String CONTEXT_FILE_NAME =
>>>>>>>>>>>>>>>> "spring.xml";
>>>>>>>>>>>>>>>> protected static final ConfigurableApplicationContext
>>>>>>>>>>>>>>>> springContext =
>>>>>>>>>>>>>>>> new ClassPathXmlApplicationContext(
>>>>>>>>>>>>>>>> CONTEXT_FILE_NAME);
>>>>>>>>>>>>>>>> DAO_Employee employeeDAO = null;
>>>>>>>>>>>>>>>> SessionFactory sessionFactory = null;
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> /**
>>>>>>>>>>>>>>>> * SetUp method
>>>>>>>>>>>>>>>> */
>>>>>>>>>>>>>>>> @Before
>>>>>>>>>>>>>>>> public void setUp() throws Exception {
>>>>>>>>>>>>>>>> employeeDAO = (DAO_Employee)
>>>>>>>>>>>>>>>> springContext.getBean("employeeDAO");
>>>>>>>>>>>>>>>> sessionFactory = (SessionFactory) springContext
>>>>>>>>>>>>>>>> .getBean("sessionFactory");
>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> @After
>>>>>>>>>>>>>>>> public void tearDown() throws Exception {
>>>>>>>>>>>>>>>> employeeDAO = null;
>>>>>>>>>>>>>>>> sessionFactory = null;
>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> /**
>>>>>>>>>>>>>>>> * Test method for saving an Employee object
>>>>>>>>>>>>>>>> */
>>>>>>>>>>>>>>>> @Test
>>>>>>>>>>>>>>>> public void testSaveEmployee() {
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Employee employee = new EmployeeImpl();
>>>>>>>>>>>>>>>> EmailAddresses emailAddress = new EmailAddressesImpl();
>>>>>>>>>>>>>>>> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
>>>>>>>>>>>>>>>> emailAddress.setOwner(employee);
>>>>>>>>>>>>>>>> EmailAddresses emailAddress1 = new EmailAddressesImpl();
>>>>>>>>>>>>>>>> emailAddress1.setEmailAddress("call2aps@gmail.com");
>>>>>>>>>>>>>>>> emailAddress1.setOwner(employee);
>>>>>>>>>>>>>>>> List<EmailAddresses> eList = new
>>>>>>>>>>>>>>>> ArrayList<EmailAddresses>();
>>>>>>>>>>>>>>>> eList.add(emailAddress);
>>>>>>>>>>>>>>>> eList.add(emailAddress1);
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> employee.setName("Ajay Chauhan");
>>>>>>>>>>>>>>>> employee.getEmailAddresses().addAll(eList);
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> try {
>>>>>>>>>>>>>>>> Transaction tx = sessionFactory.getCurrentSession()
>>>>>>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>>>>>>> employeeDAO.save(employee);
>>>>>>>>>>>>>>>> tx.commit();
>>>>>>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>>>>>>> } }
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> /**
>>>>>>>>>>>>>>>> * Test method for Load
>>>>>>>>>>>>>>>> */
>>>>>>>>>>>>>>>> @Test
>>>>>>>>>>>>>>>> public void testLoadByIdID_Employee() {
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> // set the existing id
>>>>>>>>>>>>>>>> Integer id = 1;
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Employee obj = null;
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> try {
>>>>>>>>>>>>>>>> Transaction txn = sessionFactory.getCurrentSession()
>>>>>>>>>>>>>>>> .beginTransaction();
>>>>>>>>>>>>>>>> obj = (Employee)
>>>>>>>>>>>>>>>> sessionFactory.getCurrentSession().get("Employee",id,
>>>>>>>>>>>>>>>> LockMode.READ);
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> System.out.println("Employee ID :: " + obj.getPersonId());
>>>>>>>>>>>>>>>> System.out.println("Employee Name :: " + obj.getName());
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> List<EmailAddresses> eList = obj.getEmailAddresses();
>>>>>>>>>>>>>>>> for (EmailAddresses email : eList) {
>>>>>>>>>>>>>>>> System.out.println("Email ID :: " + email.getEmailId());
>>>>>>>>>>>>>>>> System.out.println("Email Address :: "
>>>>>>>>>>>>>>>> + email.getEmailAddress());
>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>> txn.commit();
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> } catch (Exception e) {
>>>>>>>>>>>>>>>> e.printStackTrace();
>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>> *********************************************************
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Exceptions are:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> **********************************************************
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> log4j:WARN No appenders could be found for logger
>>>>>>>>>>>>>>>> (org.springframework.context.support.ClassPathXmlApplication Context).
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> at
>>>>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> at
>>>>>>>>>>>>>>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> at
>>>>>>>>>>>>>>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> at
>>>>>>>>>>>>>>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> at
>>>>>>>>>>>>>>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> 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)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>&g
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #638897 is a reply to message #430616] |
Sat, 13 November 2010 00:54 |
No real name Messages: 6 Registered: March 2010 |
Junior Member |
|
|
Martin,
We have exactly the same issue. We have Teneo 1.0.3, and I notice that one-to-one and many-to-one associations, from the mapping file, are marked lazy="false", i.e. eagerly loaded.
This is a rather serious issue for us, because our graph of objects is rather dense (many associations from one object to another), so in a single Hibernate session when we want to examine essentially one object, the eager loading due to Teneo's mapping file causes hundreds of objects to be sucked, greatly deteriorating performance in unoptimized DBs.
What is the reason these association types are forced into eager loading. There doesnt seem to be an option to change this. We are not in a position to upgrade Teneo versions to the more recent versions. Will an upgrade to Teneo 1.0.4 help? Is it possible for us to copy over some pieces of code to ensure that loading is lazy?
Thank you for any help!
Sundeep Prakash
|
|
|
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #638905 is a reply to message #638897] |
Sat, 13 November 2010 03:42 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Prakash,
For the 1.0.4 version (not sure if this is also available in 1.0.1), there are two options which play a role:
PersistenceOptions.SET_PROXY
PersistenceOptions.ALSO_MAP_AS_CLASS
both should be set to true to get lazy loading for many-to-one to work. One-to-one lazy loading is a bit more subtle but
these associations are often more rare.
gr. Martin
On 11/13/2010 01:54 AM, prakash_sundeep@yahoo.com wrote:
> Martin,
> We have exactly the same issue. We have Teneo 1.0.3, and I notice that
> one-to-one and many-to-one associations, from the mapping file, are
> marked lazy="false", i.e. eagerly loaded.
> This is a rather serious issue for us, because our graph of objects is
> rather dense (many associations from one object to another), so in a
> single Hibernate session when we want to examine essentially one object,
> the eager loading due to Teneo's mapping file causes hundreds of objects
> to be sucked, greatly deteriorating performance in unoptimized DBs.
>
> What is the reason these association types are forced into eager
> loading. There doesnt seem to be an option to change this. We are not in
> a position to upgrade Teneo versions to the more recent versions. Will
> an upgrade to Teneo 1.0.4 help? Is it possible for us to copy over some
> pieces of code to ensure that loading is lazy?
>
> Thank you for any help!
>
> Sundeep Prakash
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Goto Forum:
Current Time: Thu Mar 28 19:05:14 GMT 2024
Powered by FUDForum. Page generated in 0.06437 seconds
|