sqlmap在eclipse中运行,好好的。放到tomcat7中抛出如下异常:
Caused by: java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common
.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Er
ror parsing XPath ‘/sqlMapConfig/sqlMap‘. Cause: com.ibatis.common.xml.NodeletE
xception: Error parsing XML. Cause: org.xml.sax.SAXParseException: The string "
--" is not permitted within comments.
解决方法:去掉全部的sqlmap文件注释。
另外sqlmap中出现了特殊符号:
<select id="selectPartsInfoToCar" resultMap="TblSpPartsinfoResultMap" parameterClass="map"> <![CDATA[ SELECT tbl.* FROM `tbl_sp_partsinfo` tbl join `jnt_sp_partsinfocar` jnt on tbl.id = jnt.f_partsinfo_id and jnt.f_carbrand_id = #fCarbrandId# and jnt.f_carsn_id = #fCarsnId# and jnt.f_caroutput_id = #fCaroutputId# and jnt.f_caryear_id = #fCaryearId# order by tbl.created_date desc ]]> </select>
需要加上<![CDATA[ ]]>