DWR文件上传报错

时间:2022-10-22 19:41:21
尝试用DWR实现上传文件功能,结果报错,怀疑是jar版本问题,DWR版本3.0、commons-fileupload-1.3.1.jar、commons-io-1.3.2.jar,但是包换来换去都没解决,请各位大侠不吝赐教,拜谢! DWR文件上传报错错误如下:
2015-4-28 16:47:34 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet dwr-invoker threw exception
java.lang.NoSuchMethodError: org.apache.commons.fileupload.servlet.ServletFileUpload.setProgressListener(Lorg/apache/commons/fileupload/ProgressListener;)V
at org.directwebremoting.dwrp.CommonsFileUpload.parseRequest(CommonsFileUpload.java:72)
at org.directwebremoting.dwrp.Batch.parsePost(Batch.java:135)
at org.directwebremoting.dwrp.Batch.<init>(Batch.java:58)
at org.directwebremoting.dwrp.CallBatch.<init>(CallBatch.java:46)
at org.directwebremoting.dwrp.BaseCallHandler.handle(BaseCallHandler.java:74)
at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:120)
at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:141)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)

1 个解决方案

#1


org.apache.commons.fileupload.servlet.ServletFileUpload.setProgressListener(Lorg/apache/commons/fileupload/ProgressListener;)
几个jar包的版本不一致导致找不到方法

#1


org.apache.commons.fileupload.servlet.ServletFileUpload.setProgressListener(Lorg/apache/commons/fileupload/ProgressListener;)
几个jar包的版本不一致导致找不到方法