No unique bean of type [javax.persistence.EntityManagerFactory] is defined

来源:互联网 发布:自动化交易编程设计 编辑:程序博客网 时间:2024/05/13 12:37

今天运行以前同事交接给我的老项目,是用struts2+spring+jpa搭建的,平常用ssh较多,jpa使用的较少,所以就遇到问题。

No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 0

最后的解决方法就是在web.xml中配置数据源的路径。因为没有配置数据源,也就没有定义EntityManagerFactory,所以也就不可能有bean。

阅读全文
0 0
原创粉丝点击