java.io.IOException: Could not find resource SqlMapConfig.xml at org.apache.ibatis.io.Resources.get
来源:互联网 发布:9788 微信 网络不稳定 编辑:程序博客网 时间:2024/05/16 15:55
新建mybatis项目时,单元测试报错
java.io.IOException: Could not find resource SqlMapConfig.xml
at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:110)
at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:97)
at com.itherma.mybatis.po.MybatisFist.findUserByIdTest(MybatisFist.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
解决方法:
错误信息表示找不到资源文件SqlMapConfig.xml,。这是因为该文件没有放在src下,默认情况下不会被加载,需要手动将其所在的文件夹添加到build path->use as source folder.
- java.io.IOException: Could not find resource SqlMapConfig.xml at org.apache.ibatis.io.Resources.get
- java.io.IOException: Could not find resource SqlMapConfig.xml
- java.io.IOException: Could not find resource SqlMapConfig.xml
- mybatis进行测试时找不到配置文件:java.io.IOException: Could not find resource config/SqlMapConfig.xml 的解决
- mybatis配置报错java.io.IOException: Could not find resource mybatis-config.xml
- mybatis错误——java.io.IOException: Could not find resource com/xxx/xxxMapper.xml
- MyBatis配置报错java.io.IOException: Could not find resource mybatis-conf.xml
- mybatis 报错 java.io.IOException: Could not find resource mybatis-config.xml
- IDEA搭建mybatis项目之异常:java.io.IOException: Could not find resource mapping/UserMapper.xml
- IDEA搭建MyBatis项目之异常:java.io.IOException: Could not find resource mapping/******.xml
- IDEA Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource ***
- mybatis javaweb java.lang.ClassNotFoundException: org.apache.ibatis.io.Resources
- java.lang.NoClassDefFoundError: org/apache/ibatis/io/Resources
- org.apache.ibatis.builder.xml.IncompleteStatementException: Could not find result map java.util.Map
- java.io.FileNotFoundException: Could not open ServletContext resource [/SpringContext.xml]
- 找不到文件异常java.io.IOException: Resource [classpath:shiro.ini] could not be found.
- Shrio | java.io.IOException: Resource [classpath:shiro.ini] could not be found
- java.io.IOException: java.lang.reflect.InvocationTargetException at org.apache.hadoop.hbase.client.
- 半导体存储器详细搬运总结:关于RAM,ROM和硬盘
- R语言向量_向量元素的名称
- 举例urlopen中的data用法
- Android 深入理解Android中的自定义属性
- 在windows10下面 modelsim10.1a的安装
- java.io.IOException: Could not find resource SqlMapConfig.xml at org.apache.ibatis.io.Resources.get
- 文章标题 codeforce 812C Sagheer and Nubian Market(二分)
- HDU 1248 寒冰王座
- js小知识
- Controlling Access to the Kubernetes API
- 插件介绍: DataTables 表格分页
- hdu 5608 function
- 54 C语言switch语句
- Python Coding 小技巧