中级项目课第一个测试数据库的用例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 17:47
可以去课程的下方提问哦,会有助教给解答的~
点赞 回复 分享
发布于 2018-07-20 14:14

相关推荐

点赞 评论 收藏
分享
仁者伍敌:牛子这些人还会点一个自动回复,boss都不带回复的
点赞 评论 收藏
分享
06-28 22:48
已编辑
广东金融学院 Java
小浪_Coding:学院本+这俩项目不是buff叠满了嘛
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务