SpringCloud项目运行报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘deptController’: Unsatisfied dependency expressed through field ‘deptService’; nested exception is : 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.io.FileNotFoundException: Could not open ServletContext resource [/classspath:mybatis/mybatis-config.xml]
Caused by: org.xml.sax.SAXParseException: 元素类型为 “setting” 的内容必须匹配 “EMPTY”。
问题所在:mybatis的配置文件写法有错
解决办法:由报错提示 元素类型为 “setting” 的内容必须匹配 “EMPTY” ,所以修改setting为
再次运行后,错误消失,项目运行成功!