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
少了個# 號