段秦安 2022-06-02 20:35 采纳率: 80%
浏览 58
已结题

springboot项目报错

使用springboot,springboot报错

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in file [C:\ideaProjects\demo\target\classes\com\example\demo\dao\UserDao.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

想知道怎么解决,让项目启动起来

  • 写回答

5条回答 默认 最新

  • 投三分的金闪闪 2022-06-02 21:04
    关注

    你调用dao层的UserDao这个类但是没被注入Spring容器,看后面的报错可能是你mybatis出了问题,检查一下自己的mybatis依赖pom文件和UserDao对应的mybatis的xml配置文件。排查不出来可以把依赖和xml还有UserDao文件发我看看。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(4条)

报告相同问题?

问题事件

  • 系统已结题 6月11日
  • 已采纳回答 6月3日
  • 创建了问题 6月2日