gispda
Aug 29th, 2004, 12:14 AM
Hi all.
I use spring+hibernate+weblogic8.1.2. I write a EJB using spring ejb implments,hibernate sessionfactory has already startup when weblogic 8.1 start,configured a jndi resource.
But I confused how to write the sevice-layercontext.xml,look like this:
<bean id="sessionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"><value>hibernate</value></property>
</bean>
<bean id="daoTarget" class="com.caec.amis.dao.basemn.BasedbmnDaoImpl">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
BasedbmnDaoImpl implments HibernateDaoSupport,So its hibernate sessionfactory can not cast from Jndiobject to hibernate session factory property
Look like as follow is right,I configure the hibernate sessonfactory to a LocalSessionFactoryBean,so I remove the jndiobject of hibernate from weblogic startup Class.
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFact oryBean">
<property name="configLocation"><value>com/caec/amis/ctx/service/Hibernate.cfg.xml</value></property>
</bean>
Then It is only solution to hibernate sessionfactory using LocalSessionFactoryBean by spring.
Any help will be appreciated.
Thanks.
I use spring+hibernate+weblogic8.1.2. I write a EJB using spring ejb implments,hibernate sessionfactory has already startup when weblogic 8.1 start,configured a jndi resource.
But I confused how to write the sevice-layercontext.xml,look like this:
<bean id="sessionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"><value>hibernate</value></property>
</bean>
<bean id="daoTarget" class="com.caec.amis.dao.basemn.BasedbmnDaoImpl">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
BasedbmnDaoImpl implments HibernateDaoSupport,So its hibernate sessionfactory can not cast from Jndiobject to hibernate session factory property
Look like as follow is right,I configure the hibernate sessonfactory to a LocalSessionFactoryBean,so I remove the jndiobject of hibernate from weblogic startup Class.
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFact oryBean">
<property name="configLocation"><value>com/caec/amis/ctx/service/Hibernate.cfg.xml</value></property>
</bean>
Then It is only solution to hibernate sessionfactory using LocalSessionFactoryBean by spring.
Any help will be appreciated.
Thanks.