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

相关推荐

Yki_:你要算时间成本呀,研究生两三年,博士三四年,加起来就五六年了,如果你本科去腾讯干五年,多领五年的年薪,加上公司内涨薪,可能到时候十五年总薪资也跟博士差不多
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
06-24 20:25
腾讯今年实习招了这么多人,后面秋招还会招人吗??想着秋招再战来着
牛客965593684号:腾讯好像2020年之后就是实习生招得多,应届生基本上不招,纯实习转正
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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