程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> ibatis-ibaties啟動報錯 t.SqlMapException: Unrecognized parameter mapping field

ibatis-ibaties啟動報錯 t.SqlMapException: Unrecognized parameter mapping field

編輯:編程綜合問答
ibaties啟動報錯 t.SqlMapException: Unrecognized parameter mapping field

ibaties 啟動報錯:
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [configs/ibatis/sqlMapConfig.xml]; nested exception is 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/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: Unrecognized parameter mapping field: 'RO2CR.ROLE_OBJ_RULE_ID' in
union all
SELECT RO2CR.CFG_RULE_ID,RO2CR.ROLE_OBJ_RULE_ID,NULL REQ_OBJ_RELA_ID,RIC.REQ_ITEM_CFG_ID,'1' TYPE
FROM ROLE_OBJ_2_CFG_RULE RO2CR, CFG_RULE CR,CFG_RULE_2_ITEM_CFG CR2IC,REQ_ITEM_CFG RIC
WHERE RO2CR.CFG_RULE_ID = CR.CFG_RULE_ID AND CR2IC.CFG_RULE_ID=CR.CFG_RULE_ID
AND RIC.REQ_ITEM_CFG_ID=CR2IC.REQ_ITEM_CFG_ID
and cr.ppm_seq =

at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:341)
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:291)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 37 more

源碼:

<![CDATA[

SELECT RO2CR.CFG_RULE_ID,RO2CR.ROLE_OBJ_RULE_ID,RO2IC.REQ_OBJ_RELA_ID,RO2IC.REQ_ITEM_CFG_ID,'0' TYPE
FROM ROLE_OBJ_2_CFG_RULE RO2CR, CFG_RULE CR,REQ_OBJ_RELA ROR,REQ_OBJ_2_ITEM_CFG RO2IC,REQ_ITEM_CFG RIC
WHERE RO2CR.CFG_RULE_ID = CR.CFG_RULE_ID AND ROR.CFG_RULE_ID=CR.CFG_RULE_ID
AND ROR.REQ_OBJ_RELA_ID=RO2IC.REQ_OBJ_RELA_ID AND RIC.REQ_ITEM_CFG_ID=RO2IC.REQ_ITEM_CFG_ID
and cr.ppm_seq = #seq#
and ro2cr.offer_role_id = #offerRoleId:DECIMAL
and ror.obj_id=#objId#
union all
SELECT RO2CR.CFG_RULE_ID,RO2CR.ROLE_OBJ_RULE_ID,NULL REQ_OBJ_RELA_ID,RIC.REQ_ITEM_CFG_ID,'1' TYPE
FROM ROLE_OBJ_2_CFG_RULE RO2CR, CFG_RULE CR,CFG_RULE_2_ITEM_CFG CR2IC,REQ_ITEM_CFG RIC
WHERE RO2CR.CFG_RULE_ID = CR.CFG_RULE_ID AND CR2IC.CFG_RULE_ID=CR.CFG_RULE_ID
AND RIC.REQ_ITEM_CFG_ID=CR2IC.REQ_ITEM_CFG_ID
and cr.ppm_seq = #seq#
and ro2cr.offer_role_id = #offerRoleId:DECIMAL
and ric.item_spec_id=#itemSpecId#
]]>







怎麼就報錯了啊,是不是不能用union進行拼接,union 下面的SQL去掉就不報錯了,不知道咋回事啊!!!!

最佳回答:


日 知道了。是sql的格式不對,害的我搞了3個小時。

and ro2cr.offer_role_id = #offerRoleId:DECIMAL

少了個# 號

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved