问题:解决IDEA编写第一个MyBatis遇到流找不到mybatis-config.xml配置文件问题

涉及内容:读取与xml文件

流读取的代码:

String resource="mybatis-config.xml";//流读取的文件
InputStream inputStream = Resources.getResourceAsStream(resource);//流
sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);

出现的错误问题:  

java.io.IOException: Could not find resource mybatis-config.xml

IDEA解决的方法:

 设置完成效果:

 END

原文地址:https://www.cnblogs.com/zjazn/p/13700694.html