|
It's weird, there is nothing wrong with the configuration, the bean always gets no value, and the log analysis is done.
Configuration file:
<? xml version = "1.0" encoding = "UTF-8"?>
<! DOCTYPE beans PUBLIC "-// SPRING // DTD BEAN // EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-Hibernate SessionFactory->
<bean id = "sessionFactory" class = "org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<!-hibernate configFile Location->
<property name = "configLocation">
<value> classpath: hibernate.cfg.xml </ value>
</ property>
<!-References all OR mapping files.->
<property name = "mappingDirectoryLocations">
<list>
<value> classpath: com / ziptimes / domain </ value>
</ list>
</ property>
</ bean>
<!-Pass the sessionfactory to HibernateTemplat->
<bean id = "hibernateTemplate" class = "org.springframework.orm.hibernate3.HibernateTemplate">
<property name = "sessionFactory">
<ref bean = "sessionFactory" />
</ property>
</ bean>
<!-Pass the HibernateTemplat to DAO->
<bean id = "managerSupport" class = "com.ziptimes.manager.ManagerSupport">
<property name = "hibernateTemplate">
<ref bean = "hibernateTemplate" />
</ property>
</ bean>
</ beans>
bean:
public class ManagerSupport extends HibernateDaoSupport {
public ManagerSupport () {
log.debug ("Get the injected value:" + super.getHibernateTemplate ());
}
} |
|