-
环境
maven mybatis3.5.4 jdk1.8 开发工具idea -
报错详细
java.io.IOException: Could not find resource mybatis-config.xml
at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:114)
at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:100)
at com.mvp.www.hello.xml.Main.main(Main.java:21)
Exception in thread "main" java.lang.NullPointerException
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:84)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64)
at com.mvp.www.hello.xml.Main.main(Main.java:25)
Process finished with exit code 1
-
解决
pom.xml配置标签packaging改为jar或war
-
packaging类型
jar,war,ear,pom 默认jar
maven官网:https://maven.apache.org/ -
小记
不积跬步,无以至千里;不积小流,无以成江海。