中级项目课第一个测试数据库的用例run不动

今天做到中级项目里的mybatis的第一个测试数据库例子的时候run不了InitDatabaseTests,看控制台里最先的warn是这个
WARN 8600 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDAO' defined in file [E:\java_project\toutiao1\target\classes\com\nowcoder\dao\UserDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': 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.io.FileNotFoundException: class path resource [mybatis-config.xml] cannot be opened because it does not exist; 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.io.FileNotFoundException: class path resource [mybatis-config.xml] cannot be opened because it does not exist
最后一句是class path resource [mybatis-config.xml] cannot be opened because it does not exist
这是因为我的mybatis-config.xml文件没放对位置吗?我就是按照视频上来的啊,也在application.properties文件里加mybatis.config-location=classpath:mybatis-config.xml这句了啊,到底怎么回事啊?求小伙伴们帮帮忙!
#Java##测试#
全部评论
可以去课程的下方提问哦,会有助教给解答的~
点赞 回复 分享
发布于 2018-07-20 14:14
好了,知道了,我把那个文件放错位置了。。。。
点赞 回复 分享
发布于 2018-07-20 17:47

相关推荐

02-15 09:23
已编辑
深圳技术大学 Java
德勤 后端 OC 实习140/天,转正税前7k
恶龙战士:不如码农烧烤
点赞 评论 收藏
分享
01-15 13:52
已编辑
河南大学 Java
六年要多久:标准头像,不吃香菜😂
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务