mybatis-config.xml找不到

来源:13-5 dao的迁移下

慕圣3009968

2019-07-11

输入正

启动报错说找不到mybatis.config-file

Caused by: java.io.FileNotFoundException: class path resource [mybatis.config-file] cannot be opened because it does not exist


我在application.yml里面配置

mybatis:

  config-file: mybatis-config.xml

  mapper-locations: /db/mapper/**.xml

  type-alias-packages: com.project.scan.db.entity


然后再SessionFactoryConfiguration里面引用

    @Value("mybatis.config-file")

    private String mybatisConfigFile;


http://img.mukewang.com/szimg/5d26ab030938f74100000000.jpg


写回答

1回答

翔仔

2019-07-11

同学好,咱们的配置好像不太一样,建议在没有解决问题的能力之前,先保持和视频一致,后续等所有功能搞定后,再来试着用yaml来解决问题,配置的东西无伤大雅,先让过才好

0
3
翔仔
同学可以用你本地的mysql客户端按照程序的配置连接下你的mysql服务 看能否连接上
2019-07-12
共3条回复

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5128 学习 · 8152 问题

查看课程