Posted content length of 17230056 exceeds limit of 10485760

jfinal 上传文件,文件超过默认大小报错如下:

com.jfinal.upload.ExceededSizeException: com.oreilly.servlet.multipart.ExceededSizeException: Posted content length of 17230056 exceeds limit of 10485760
at com.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequest.java:124)
at com.jfinal.upload.MultipartRequest.(MultipartRequest.java:68)
at com.jfinal.core.Controller.getFiles(Controller.java:857)
at com.jfinal.core.Controller.getFile(Controller.java:867)
at com.jfinal.aop.Invocation.invoke(Invocation.java:97)
	at cn.com.pajx.he.core.interceptor.ExceptionInterceptor.intercept(ExceptionInterceptor.java:18)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
	at cn.com.pajx.he.core.interceptor.CORSInterceptor.intercept(CORSInterceptor.java:26)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:82)
	at cn.com.pajx.he.core.handler.APINotFoundHandler.handle(APINotFoundHandler.java:35)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:89)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2521)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2510)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.oreilly.servlet.multipart.ExceededSizeException: Posted content length of 17230056 exceeds limit of 10485760
	at com.oreilly.servlet.multipart.MultipartParser.(MultipartParser.java:175)
	at com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:224)
	at com.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequest.java:107)
	... 34 more

解决方法:
在JFConfig文件中,configConstant方法配置

//上传app版本大小 <=30MB
 constants.setMaxPostSize(31457280);

你可能感兴趣的:(Posted content length of 17230056 exceeds limit of 10485760)