使用ibatis时遇到Error parsing XPath '/sqlMapConfig/sqlMap'低级错误

使用ibatis时,遇到一错误。是疏忽造成的,留作记录。
错误信息如下:

RROR Plat.Ser: Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/insert'.  Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Insert_column'
java.lang.RuntimeException: Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/insert'.  Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Insert_column'
        at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:89)

 

Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/insert'.  Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Insert_column'
        at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53)
        at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:86)
        ... 27 more
Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/insert'.  Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Insert_column'
        at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)
        at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)
        at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102)
        at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
        at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51)
        ... 28 more
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/insert'.  Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Insert_column'
        at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53)
        at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:51)
        at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:410)
        at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)
        ... 32 more
Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/insert'.  Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Insert_column'
        at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)
        at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)
        at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102)
        at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
        at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51)
        ... 35 more
Caused by: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Insert_column'
        at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.parseDynamicTags(SqlStatementParser.java:255)
        at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.processSqlStatement(SqlStatementParser.java:204)
        at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.parseGeneralStatement(SqlStatementParser.java:120)
        at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$19.process(SqlMapParser.java:563)
        at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)
        ... 39 more

 代码如下:

<insert id="Insert" parameterClass="uecpSplitOrder">
		insert into umpay.$tableName$(
			<include refid="Insert_column" />
		) 
		values (
			<include refid="Insert_value" />
		)
</insert>
<sql id="Insert_column">
................................
</sql>
<sql id="Insert_value">
.................................
</sql>

 相信睿智的各位都已经发现了问题。没错,引用者放在了被引用者的前面,ibatis解析的时候找不到refid的对象,从而导致出错。

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值