AjayCh
Jun 9th, 2008, 01:33 AM
Hi,
I am new to Hibernate and Spring. I am getting the lazyInitialization error in my application. I am using struts2 with hibernate and spring. This seems to be a common problem and I found many posts on it. But I am unable to find a common solution for this problem.
I tried referring the 'OpenSessionInViewFilter' in my web.xml.
<filter>
<filter-name>lazyLoadingFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSes sionInViewFilter</filter-class>
</filter>
Now I am getting another error
'No bean named 'sessionFactory' is defined'.
This is because I have two 'applicationContext-dao-.xml' files with beans sessionFactoryMediware and sessionFactoryClinical defined in them. I need to use these two beans separately. So I dont have the sessionFactory bean defined. This results in the above mentioned error.
Is there any other way to solve the lazy initialization problem?
Any help would be greatly appreciated.
Thanks & Regards
Ajay
I am new to Hibernate and Spring. I am getting the lazyInitialization error in my application. I am using struts2 with hibernate and spring. This seems to be a common problem and I found many posts on it. But I am unable to find a common solution for this problem.
I tried referring the 'OpenSessionInViewFilter' in my web.xml.
<filter>
<filter-name>lazyLoadingFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSes sionInViewFilter</filter-class>
</filter>
Now I am getting another error
'No bean named 'sessionFactory' is defined'.
This is because I have two 'applicationContext-dao-.xml' files with beans sessionFactoryMediware and sessionFactoryClinical defined in them. I need to use these two beans separately. So I dont have the sessionFactory bean defined. This results in the above mentioned error.
Is there any other way to solve the lazy initialization problem?
Any help would be greatly appreciated.
Thanks & Regards
Ajay