ibatis 一个简单的应用,报错:
耶西2022-10-04 11:39:541条回答
ibatis 一个简单的应用,报错:
java.lang.ExceptionInInitializerError
Caused by:java.lang.RuntimeException:Something bad happened while building the SqlMapClient instance.java.io.IOException:Could not find resource SqlMapConfig.xml
x05at com.ibatisTest.(ibatisTest.java:23)
Caused by:java.io.IOException:Could not find resource SqlMapConfig.xml
x05at com.ibatis.common.resources.Resources.getResourceAsStream(Resources.java:110)
x05at com.ibatis.common.resources.Resources.getResourceAsStream(Resources.java:95)
x05at com.ibatis.common.resources.Resources.getResourceAsReader(Resources.java:161)
x05at com.ibatisTest.(ibatisTest.java:18)
Exception in thread "main"
这个路径应该怎么设,这个类和那个SqlMapConfig.xml 在同级目录下,
Reader reader = Resources.getResourceAsReader("SqlMapConfig.xml");
是这样吗
java.lang.ExceptionInInitializerError
Caused by:java.lang.RuntimeException:Something bad happened while building the SqlMapClient instance.java.io.IOException:Could not find resource SqlMapConfig.xml
x05at com.ibatisTest.(ibatisTest.java:23)
Caused by:java.io.IOException:Could not find resource SqlMapConfig.xml
x05at com.ibatis.common.resources.Resources.getResourceAsStream(Resources.java:110)
x05at com.ibatis.common.resources.Resources.getResourceAsStream(Resources.java:95)
x05at com.ibatis.common.resources.Resources.getResourceAsReader(Resources.java:161)
x05at com.ibatisTest.(ibatisTest.java:18)
Exception in thread "main"
这个路径应该怎么设,这个类和那个SqlMapConfig.xml 在同级目录下,
Reader reader = Resources.getResourceAsReader("SqlMapConfig.xml");
是这样吗
已提交,审核后显示!提交回复
共1条回复
- 安生与七月 共回答了21个问题
|采纳率85.7% - SqlMapConfig.xml
这个配置文件没找到.你看下你配置的路径是否正确 - 1年前
相关推荐
- ibatis动态sql配置启动时提示:The content of elements must consist of w
ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data...
ibatis配置如下,高手帮我看看.
SELECT L_SERIALNO as serialno,
C_CONTENT as content,
C_MOBILENO as mobileno,
C_DATE as cdate,
C_TIME as ctime,
C_FUNDACCO as fundacco,
L_BACKID as backid,
C_TASKCODE as taskcode,
C_BACK as back,
C_BACKCONTENT as backcontent,
C_BACKDATE as backdate,
C_BACKTIME as backtime,
c_pipe as l_type
FROM TSMS_RECEIVE
C_TASKCODE =#taskCode#
C_DATE >= #startDate#
C_DATE漠北风缘1年前1 -
pxhlijia 共回答了22个问题
|采纳率90.9%把下面这个表达式反过来写就可以了
C_DATE = C_DATE
记住:在ibatis的配置文件中不能出现小于号1年前查看全部
- ibatis的问题java.sql.SQLException: Error: executeQueryForObject
ibatis的问题
java.sql.SQLException: Error: executeQueryForObject returned too many results.
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForObject(MappedStatement.java:124)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:518)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:493)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:110)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:86)
at com.cgj.dao.EmployeeDaoImpl.select(EmployeeDaoImpl.java:13)
at com.cgj.serice.ServiceImpl.selectEmployee(ServiceImpl.java:44)
at com.cgj.main.Testit.main(Testit.java:24)
Exception in thread "main" java.lang.NullPointerException
at com.cgj.main.Testit.main(Testit.java:25)
请问这是什么错误
orrtty1年前1 -
不许打我家猫 共回答了15个问题
|采纳率86.7%eturned too many results说的是返回的值多于一个了,executeQueryForObject要求只返回一个值,看看你的这个查询是应该用executeQueryForList,还是本身的Sql有问题1年前查看全部
- ibatis 读音 谁知道?
稻草人和小青蛙1年前1
-
roninY 共回答了12个问题
|采纳率75%['ai bei ti s]
呗提丝1年前查看全部
大家在问
- 1生物必修一物质的跨膜运输一道题,求解释.
- 2利用柯西不等式证明设a,b,c,d为正实数,(ab+cd)(ac+bd)≥4abcd
- 3求4,5,1,2,
- 4如果以x为未知数的方程x^2-(1-2m)x+m-1=0没有实数根,那么m的取值范围是什么?
- 5During the Second World War, it was difficult to travel by p
- 6某学校社团对该校高一学生学习出现文理科偏科现象进行调查.随机抽查若干名学生和家长对高一学生学习出现文理科偏科现象的看法,
- 70.43kw.h/24h代表耗电量是多少?
- 8写一篇表示方位的作文 英文,不少与50词
- 9读阅读材料《众志成城共渡难关》,完成问题。 众志成城共渡难关 ①“5·l2”汶川特大地震发生后,我们听得最多的词语就
- 10如何利用审美心里知识提高旅游服务质量
- 11如何利用镜面反射原理让两个人只能看见其中一个人,但是另一个人看不见对方,
- 12下列说法中不正确的是( )A.在国际单位制中,热功率的单位是瓦特B.电动机、电灯泡铭牌上标的功率是它们的热功率C.电流
- 13将80g质量分数为35%的浓盐酸,稀释成10%的稀盐酸,需加水的质量为( )
- 14暮雨潇潇江上村什么意思
- 15(2011•天河区一模)下列做法正确的是( )