[Building Sakai] Unable to getHibernate template

KetanNale ketan_nale at yahoo.com
Thu Apr 9 04:04:01 PDT 2009




Hello,

 i have problem in getting object of getHibernateTemplate() in my manager.
Please anyone can tell me where is the problem ?

I have gone through the session creation document as per your guidance and
created following components.xml in myapp's    ---
components/src/webapp/WEB-INF

"org.sakaiproject.api.app.person.PersonManagerImpl" is my manager with
package  
can you guess where is problem in getting template........


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
<bean id="org.sakaiproject.person.dao.SessionFactory"
parent="org.sakaiproject.springframework.orm.hibernate.SessionFactoryBase">

<property name="mappingResources">
<list>
				<value>
					org/sakaiproject/component/app/person/AddressImpl.hbm.xml
				</value>
				<value>
					org/sakaiproject/component/app/person/PersonImpl.hbm.xml
				</value>
</list>
</property>
</bean>

<!--
 create a transactionManager bean from the sakai tool SessionFactory 
-->

<bean id="org.sakaiproject.person.dao.HibernateTransactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">

<property name="sessionFactory">
<ref bean="org.sakaiproject.person.dao.SessionFactory"/>
</property>
</bean>

<!--
 create a MyToolManagerDao bean, and give it the HibernateTemplate bean from
above 
-->

<bean id="org.sakaiproject.person.dao.MyAppDaoHibernateTarget"
class="org.sakaiproject.api.app.person.PersonManagerImpl" singleton="true">

<property name="sessionFactory">
<ref bean="org.sakaiproject.person.dao.SessionFactory"/>
</property>
</bean>

<!--
 create a transaction interceptor which sits between the dao and the
		transaction manager that we created in the previous block, this
		helps us with transaction control 
-->

<bean id="org.sakaiproject.person.dao.MyAppDao"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">

<property name="transactionManager">
<ref bean="org.sakaiproject.person.dao.HibernateTransactionManager"/>
</property>

<property name="target">
<ref bean="org.sakaiproject.person.dao.MyAppDaoHibernateTarget"/>
</property>

<property name="transactionAttributes">

<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
</beans>



-- 
View this message in context: http://www.nabble.com/Unable-to-getHibernate-template-tp22968135p22968759.html
Sent from the Sakai - Development mailing list archive at Nabble.com.



More information about the sakai-dev mailing list