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[  ]]>

转载于:https://www.cnblogs.com/simpledev/p/3525953.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<?xml version="1.0" encoding="UTF-8"?> <!-- author:hekesong --> <sqlMap> <!-- 查询作物种植信息列表 --> <select id="queryAreaCrops4List" parameterClass="commonj.sdo.DataObject" resultClass="commonj.sdo.DataObject" > select t.*,p.basename,c.cropsname,c.varieties,c.growthcycle,c.recoverycycle,gh.housename,ga.areaname,(case t.status when 1 then '种植' else '已完成' end) as status_flag from zhnl_area_crops t LEFT JOIN zhnl_productionbase p on t.baseid = p.id LEFT JOIN zhnl_crops c on t.cropsid = c.id LEFT JOIN zhnl_greenhouse gh on t.greenhouseid = gh.id LEFT JOIN zhnl_greenhouse_area ga on t.areasid = ga.id where 1=1 <isNotNull prepend="and" property="basename"> p.basename like '%$basename$%' </isNotNull> <isNotNull prepend="and" property="housename"> gh.housename like '%$housename$%' </isNotNull> <isNotNull prepend="and" property="areaname"> ga.areaname like '%$areaname$%' </isNotNull> <isNotNull prepend="and" property="batchcode"> t.batchcode like '%$batchcode$%' </isNotNull> <isNotNull prepend="and" property="manageScope"> t.greenhouseid in ($manageScope$) </isNotNull> order by t.createtime desc </select> <!-- 根据种植区域id获取种植信息 --> <select id="queryAreaCropsByAreaId" parameterClass="commonj.sdo.DataObject" resultClass="commonj.sdo.DataObject" > select t.*,c.cropsname,c.varieties from zhnl_area_crops t LEFT JOIN zhnl_crops c on t.cropsid = c.id where 1=1 and t.areasid= #areasid# and t.status = '1' </select> <!-- 根据种植批次更新种植信息状态--> <update id="updateStatusByBatchcode" parameterClass="commonj.sdo.DataObject" > update zhnl_area_crops t set t.status = #status# where t.batchcode=#batchcode# </update> <update id="updateStateByBatchcode" parameterClass="commonj.sdo.DataObject" > update zhnl_area_crops t set t.state = #state# where t.batchcode=#batchcode# </update> <select id="getCpfjBycppc" parameterClass="map" resultClass="com.nl.Intelligentag.platform.area_xg.ZhnlAreaCropsCpfj"> select * from zhnl_area_crops_cpfj where batchcode=#cppc# </select> <select id="getCropsBycppc" parameterClass="map" resultClass="com.nl.Intelligentag.platform.productionbase.ZhnlAreaCrops"> select * from zhnl_area_crops where batchcode=#cppc# </select> </sqlMap>
07-14

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值