我按照 开发指南上的方法配置了下 运行junittest后错误为
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personDAO' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [net.sf.hibernate.impl.SessionFactoryImpl] to required type [org.hibernate.SessionFactory] for property 'sessionFactory']
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [net.sf.hibernate.impl.SessionFactoryImpl] to required type [org.hibernate.SessionFactory] for property 'sessionFactory'
配置文件为applicationContext.xml
Failed to convert property value of type [net.sf.hibernate.impl.SessionFactoryImpl] to required type [org.hibernate.SessionFactory]
写的狠清楚了!personDAO中属性sessionFactory类型和你想wire的类型对不上!