Cause: java.lang.IllegalArgumentException: argument type mismatch

原创 2012年03月26日 18:50:47

	public XiuItemAttr selectByPrimaryKey(Integer xiaId) throws SQLException {
		return (XiuItemAttr) sqlMapClient.queryForObject(
				"XIU_ITEM_ATTR.ibatorgenerated_selectByPrimaryKey", xiaId);
	}

ibatis

  <select id="ibatorgenerated_selectByPrimaryKey" parameterClass="com.pltfm.index.model.XiuItemAttr" resultMap="ibatorgenerated_BaseResultMap">
    <!--
      WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
      This element was generated on Mon Mar 26 18:36:42 CST 2012.
    -->
    select <include refid="ibatorgenerated_column_name"/>
    from XIU_ITEM_ATTR
    where XIA_ID = #xiaId:INTEGER#
  </select>
通过代码生成器生成
改成这个

  <select id="ibatorgenerated_selectByPrimaryKey" parameterClass="java.lang.Integer" resultMap="ibatorgenerated_BaseResultMap">
    <!--
      WARNING - This element is automatically generated by Apache iBATIS ibator, do not modify.
      This element was generated on Mon Mar 26 18:36:42 CST 2012.
    -->
    select <include refid="ibatorgenerated_column_name"/>
    from XIU_ITEM_ATTR
    where XIA_ID = #xiaId:INTEGER#
  </select


com.ibatis.common.beans.ProbeException: Could not set property 'xiaId' to value '3511' for com.pltfm.index.model.XiuItemAttr.  Cause: java.lang.IllegalArgumentException: argument type mismatch

    at com.ibatis.common.beans.ComplexBeanProbe.setProperty(ComplexBeanProbe.java:368)
    at com.ibatis.common.beans.ComplexBeanProbe.setObject(ComplexBeanProbe.java:234)
    at com.ibatis.common.beans.GenericProbe.setObject(GenericProbe.java:90)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.executeSelectKey(SqlMapExecutorDelegate.java:427)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:387)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58)
    at com.pltfm.index.dao.XiuItemAttrDAOImpl.insertSelective(XiuItemAttrDAOImpl.java:78)
    at com.pltfm.index.service.XiuItemAttrService.addXiuItemAttr(XiuItemAttrService.java:34)
    at com.pltm.index.service.XiuItemAttrServiceTest.setUp(XiuItemAttrServiceTest.java:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.ibatis.common.beans.MethodInvoker.invoke(MethodInvoker.java:17)
    at com.ibatis.common.beans.ComplexBeanProbe.setProperty(ComplexBeanProbe.java:356)
    ... 32 more




版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

mybatis多表查询报java.lang.IllegalArgumentException: argument type mismatch

最近两天在搞多表查询:我觉得要注意一下几点 1:确定哪张表为主表 2:在主表中添加对象类型的属性,并且确定是一对一还是一对多 3:在mapper.xml中使用ResultMap的方式进行字段的整...

java.lang.IllegalArgumentException: argument type mismatch

在mysql取出int类型的数据时,在java中却是Long类型的.此时实体属性类型为int就会报错,参数类型不匹配.... 同样的事情也会使用orcale数据库时出现... 修改属性类型和对应g...
  • amtea
  • amtea
  • 2011-10-11 10:52
  • 17094

web开发时java.lang.IllegalArgumentException: argument type mismatch异常及解决方法

最近在做一个项目的时候,突然间出现了这个异常 严重:Servlet.service() for servlet action threw exception java.lang.Illegal...

Caused by: java.lang.IllegalArgumentException: argument type mismatch错误

2014-06-24 08:51:42,984 ERROR [main] (DefSchedulerEngine.java:157) - 调度引擎启动异常 org.springframework.o...

java.lang.IllegalArgumentException: argument type mismatch

五月 30, 2012 1:11:13 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() fo...

Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for ^

ERROR: org.apache.ibatis.exceptions.PersistenceException:### Error querying database.  Cause:java.l...

Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already

错误信息:Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection alr...

java.lang.IllegalArgumentException: Can't convert argument: null

tomcat6.0运行javaWeb程序时报出如下错误: java.lang.IllegalArgumentException: Can't convert argument: null at ...

java.lang.IllegalArgumentException: Can't convert argument: null

java.lang.IllegalArgumentException: Can't convert argument: null  at org.apache.tomcat.util.Introsp...

tomcat启动: java.lang.IllegalArgumentException: Can't convert argument: null

今天tomcat启动就出错了 严重: End event threw exception java.lang.IllegalArgumentException: Can't convert arg...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)