argument type mismatch异常

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了argument type mismatch异常相关的知识,希望对你有一定的参考价值。

页面表单元素是String类型 Form中对应属性为date类型引发的异常 哪位高手帮忙解决下 小弟感激不尽
Form中是实体对象 这个对象的该属性是date类型

参考技术A 实参和形参类型不匹配。 参考技术B 写例子:
假如提交:<input type="text" name="age">
在beans中:<jsp:setProperty property="类中的属性也是age" param="age" />

这样JSP引擎会将request获取的数据自动转换成javaBeans对应的数据类型.
参考技术C 改了一这个,就对了,

public boolean updateCustomer(CstCustomer customer)
throws Exception
Session session = null;
Transaction tran = null;
int result = 0;
try
session = HibernateUtils.getSession();
tran = session.beginTransaction();
CstCustomer customers = (CstCustomer) session.get(
CstCustomer.class, customer.getCustNo());
//不能用这个来做.
//BeanUtils.populate(customers, BeanUtils.describe(customer));
customers.setCustNo(customer.getCustNo());
customers.setCustName(customer.getCustName());
customers.setCustRegion(customer.getCustRegion());
customers.setCustManagerId(customer.getCustManagerId());
customers.setCustManagerName(customer.getCustManagerName());
customers.setCustLevel(customer.getCustLevel());
customers.setCustLevelLabel(customer.getCustLevelLabel());
customers.setCustSatisfy(customer.getCustSatisfy());
customers.setCustCredit(customer.getCustCredit());
customers.setCustAddr(customer.getCustAddr());
customers.setCustZip(customer.getCustZip());
customers.setCustTel(customer.getCustTel());
customers.setCustFax(customer.getCustFax());
customers.setCustWebsite(customer.getCustWebsite());
customers.setCustLicenceNo(customer.getCustLicenceNo());
customers.setCustChieftain(customer.getCustChieftain());
customers.setCustBankroll(customer.getCustBankroll());
customers.setCustTurnover(customer.getCustTurnover());
customers.setCustBank(customer.getCustBank());
customers.setCustBankAccount(customer.getCustBankAccount());
customers.setCustLocalTaxNo(customer.getCustLocalTaxNo());
customer.setCustNationalTaxNo(customer.getCustNationalTaxNo());
customers.setCustStatus(customer.getCustStatus());
customers.setCstActivities(customer.getCstActivities());
customers.setCstLinkmans(customer.getCstLinkmans());
customers.setCstServices(customer.getCstServices());

session.update(customers);
tran.commit();
result++;
catch (Exception se)
se.printStackTrace();
tran.rollback();
throw new SystemException("修改客户信息报异常!");
finally
HibernateUtils.closeSession(session);

return result > 0 ? true : false;

以上是关于argument type mismatch异常的主要内容,如果未能解决你的问题,请参考以下文章

mybatis plus出现argument type mismatch错误

jdbc利用java反射实现结果集得到处理:bug:argument type mismatch

struts上传文件报argument type mismatch错误

ssh框架 java.lang.IllegalArgumentException: argument type mismatch

VBA ByRef Argument Type Mismatch string into string

Closure call with mismatched arguments: function ‘routes.<anonymous closure>‘