qq_43755434
赤心
采纳率20%
2019-11-25 16:03

springboot启动报UnsatisfiedDependencyException

已采纳

从ssm项目复制到springboot中,编译通过,但是启动的时候报错:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'coachController': Unsatisfied dependency expressed through field 'coachServ'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'coachImpl': Unsatisfied dependency expressed through field 'coachDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'coachDao' defined in file [F:\shangwu\target\classes\com\sang\dao\coach\CoachDao.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • ilifetree hi-face 2年前

    看最后的应该是缺失jar包吧


    https://faceghost.com/question/154251

    点赞 评论 复制链接分享
  • weixin_45161172 淡腻 2年前

    mapperScan注解加到application上

    点赞 评论 复制链接分享
  • n009ww 两个娃他爹 2年前

    少包,导致bean注入失败

    点赞 评论 复制链接分享