com.ibatis.sqlmap.client.SqlMapException: There is no statement named JyPlanInfoExport.query in this SqlMap.
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:293)
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:557)
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:541)
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
org.springframework.orm.ibatis.SqlMapClientTemplate$1.doInSqlMapClient(SqlMapClientTemplate.java:238)
org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:188)
org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:236)
com.heer.jy.plan.dao.impl.JyPlanInfoExportSqlMapDAO.query(JyPlanInfoExportSqlMapDAO.java:32)
com.heer.jy.plan.service.impl.JyPlanInfoServiceImpl.getJyPlanInfoByByny(JyPlanInfoServiceImpl.java:636)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:203)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:162)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:209)
$Proxy7.getJyPlanInfoByByny(Unknown Source)
com.heer.jy.plan.struts.action.JyPlanInfoAction.export(JyPlanInfoAction.java:1140)

解决方案 »

  1.   

    你在后台调用了JyPlanInfoExport.query这个sql语句,但是sqlmap中没有找到,检查一下名字有没有错
      

  2.   

    没有错啊,sql语句也没有问题,但就是执行不到sql
      

  3.   

    ibatis的配置是这样的<typeAlias alias="jyPlanInfoExport" type="com.heer.jy.plan.dto.JyPlanInfoExportDTO" />
    <resultMap id="jyPlanInfoExportResult" class="jyPlanInfoExport">
    <result column="XH" property="xh" jdbcType="VARCHAR" /><!-- 学号 -->
    <result column="XM" property="xm" jdbcType="VARCHAR" /><!-- 姓名 -->
    <result column="XBDM" property="xbdm" jdbcType="VARCHAR" />
    <result column="SFZHM" property="sfzhm" jdbcType="VARCHAR" />
    <result column="XLDM" property="xldm" jdbcType="VARCHAR" />
    <result column="ZYDM" property="zydm" jdbcType="VARCHAR" />
    <result column="SFSFBZ" property="sfsfbz" jdbcType="VARCHAR" />
    <result column="BYNY" property="byny" jdbcType="VARCHAR" />
    </resultMap>

    <select id="query" resultMap="jyPlanInfoExportResult" parameterClass="string">
    select * from JY_PLAN_AGREEMENT_TEMP_TEST where 1=1 and byny like  #nd# 
    </select>
      

  4.   

    3L这个xml有没有在sqlMapConfig.xml中配置?例如:<sqlMap resource="com/test/bean/jyPlanInfoExport.xml" />
      

  5.   

    你sqlmap的namespace配置的是JyPlanInfoExport?
      

  6.   

    呵呵  找到错误了   因为命名空间和java代码中的命名空间不一致   首字母写成小写了  哎  真粗心  谢谢各位了