昨天在做一个SSH的例子时.启动TOMCAT服务器时就老是报错.
.........
java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is required
根据提示在配置文件中为这个类添加一个property属性
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
就不会报错.但是其它的Service类并不需要这么做,让我感觉很奇怪.最终发现原来是我让CataogService extends HibernateDaoSupport .改正后运行正常,goood
牢记....
posted on 2007-09-16 16:45
Ke 阅读(13026)
评论(7) 编辑 收藏 所属分类:
exception
FeedBack:
# re: java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is required 2007-12-26 16:41
# re: java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is required 2008-01-07 09:26
如果是DAO层的类extends HibernateDaoSupport
也需要在DAO层的类中添加
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
回复 更多评论
# re: java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is required 2009-01-09 13:59
# re: java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is required 2009-11-19 21:33
# re: java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is required[未登录] 2010-09-14 15:58
# re: java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is required[未登录] 2011-09-09 08:26
我也是继承了hibernateDaosupport类出错 汗
回复 更多评论
# re: java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is required
2014-05-08 20:16