type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: BeanUtils.populate org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495) org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:804) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.weihua.common.util.CharsetFilter.doFilter(CharsetFilter.java:35)
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:324) 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:934) org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:729) org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493) org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:804) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.weihua.common.util.CharsetFilter.doFilter(CharsetFilter.java:35)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
解决办法:
程序中用了FormFile,报上面的错,后面发现是jsp页面上,要在提交的地方:
<FORM id=frmpic name=frmpic action="addPhoto.do" οnsubmit="return check()" method=post
encType=multipart/form-data>
加上:encType=multipart/form-data,否则报上面的错误。