sqlmap文件在tomcat7中运行报错原因及<![CDATA[ ]]>
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[ ]]>
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。