spring - Bean property 'sessionFactoy' is not writable or has an invalid setter method -
working on spring+hibernate+maven code.
here's stockdaoimpl class..
import org.springframework.orm.hibernate3.support.hibernatedaosupport; import com.mkyong.stock.dao.stockdao; import com.mkyong.stock.model.stock; public class stockdaoimpl extends hibernatedaosupport implements stockdao{ public void save(stock stock){ gethibernatetemplate().save(stock); }
...
my sessionfactory defined in xml..
<!-- hibernate session factory --> <bean id="sessionfactory" class="org.springframework.orm.hibernate4.localsessionfactorybean"> <property name="datasource"> <ref bean="datasource"/> </property> <property name="hibernateproperties"> <props> <prop key="hibenate.dialect">org.hibernate.dialect.derbydialect</prop> <prop key="hibernate.show_sql">true</prop> </props> </property> <property name="mappingresources"> <list> <value>/hibernate/stock.hbm.xml</value> </list> </property> </bean>
i following error in console..bean property 'sessionfactoy' not writable or has invalid setter method...
i tried writing setter function sessionfactory in stockdaoimpl...but error saying 'setsessionfactory() in hibernatedaosupport cannot overridden'.
can pls tell me how resolve issue..
Comments
Post a Comment