中级项目课第一个测试数据库的用例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

相关推荐

05-26 09:07
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
05-09 12:23
已编辑
华南理工大学 Java
野猪不是猪🐗:给他装的,双九+有实习的能看的上这种厂我直接吃⑨✌们拿它练练面试愣是给他整出幻觉了
点赞 评论 收藏
分享
06-27 18:53
门头沟学院 Java
这样才知道自己不适合搞代码,考公去咯
只爱喝白开水:我也发现不适合搞代码,打算转非技术方向了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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