[Building Sakai] Unable to getHibernate template

Aaron Zeckoski aaronz at vt.edu
Thu Apr 9 04:14:02 PDT 2009


Could you include at least the following in your reply:
1) A description of the error you are experiencing and what you were
trying to do when the error occurred
2) The stacktrace (traceback)
3) Any relevant logs

Also, if you are writing a tool which includes a webapp only (just a
war) then you should use option 2 from the link below. If you are
writing a provider then option 1 is appropriate. If you are writing a
component (part of a tool or standalone) then you should really use
option 3.
http://bugs.sakaiproject.org/confluence/display/BOOT/Persistence

Thanks
-AZ


On Thu, Apr 9, 2009 at 12:04 PM, KetanNale <ketan_nale at yahoo.com> wrote:
>
>
>
> 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.
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
>



-- 
Aaron Zeckoski (aaronz at vt.edu)
Senior Research Engineer - CARET - Cambridge University
[http://bugs.sakaiproject.org/confluence/display/~aaronz/]
Sakai Fellow - [http://aaronz-sakai.blogspot.com/]


More information about the sakai-dev mailing list