出现javax.servlet.ServletException: BeanUtils.populate异常

exception

javax.servlet.ServletException: BeanUtils.populate
	org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
	org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	com.contract.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:37)

root cause

java.lang.IllegalArgumentException: argument type mismatch
	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:585)
	org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
	org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
	org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
	org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
	org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
	org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
	org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	com.contract.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:37)
是数据库中某字段的类型与表单中的string类型不匹配。(表单中要用string类型)
例如,如果你的数据库中的字符类型是date,在读取这个数据时需要用到格式转换,可以用DateFormat的format方法
	String str_date = DateFormat.getDateInstance.format(date);

你可能感兴趣的:(出现javax.servlet.ServletException: BeanUtils.populate异常)