开发者

Integrate hibernateTemplate with spring and Jsf

开发者 https://www.devze.com 2023-04-12 00:48 出处:网络
I have an error when I integrate JSF, Hibernate, and Spring. I have created some unit tests, and all of them work. I think that the problem is coming from JSF. I get this error:

I have an error when I integrate JSF, Hibernate, and Spring. I have created some unit tests, and all of them work. I think that the problem is coming from JSF. I get this error:

failed; nested exc开发者_开发百科eption is java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required


It has nothing to do with JSF. You're using Spring's HibernateDaoSupport, and you're not supplying it with either a Hibernate SessionFactory or a Spring HibernateTemplate. You must set one of those properties for a HibernateDaoSupport to work.

Take note that HibernateDaoSupport is considered legacy. If this is new development, you should be using the currently recommended way of using Hibernate from Spring.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号