spring+hibernate配置问题 帮忙看下谢谢了!!

[复制链接]
查看11 | 回复3 | 2008-2-13 12:43:03 | 显示全部楼层 |阅读模式
我按照 开发指南上的方法配置了下 运行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







com.mysql.jdbc.Driver





jdbc:mysql://localhost:3306/ibatis





root





root

















com/cbitech/testlogin/domain/Person.hbm.xml









true



net.sf.hibernate.dialect.MySQLDialect

net.sf.hibernate.cache.HashtableCacheProvider

true























































PROPAGATION_REQUIRED

PROPAGATION_REQUIRED

PROPAGATION_REQUIRED

PROPAGATION_REQUIRED,readOnly







帮帮忙啊谢谢了 啊
回复

使用道具 举报

千问 | 2008-2-13 12:43:03 | 显示全部楼层
BEAN创建错误,是哪个没写吧,要不就是哪个BEAN没找到……
回复

使用道具 举报

千问 | 2008-2-13 12:43:03 | 显示全部楼层
Failed to convert property value of type [net.sf.hibernate.impl.SessionFactoryImpl] to required type [org.hibernate.SessionFactory]
写的狠清楚了!personDAO中属性sessionFactory类型和你想wire的类型对不上!
回复

使用道具 举报

千问 | 2008-2-13 12:43:03 | 显示全部楼层
那要改那里呢 ??
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行