jfinal 小文件上传没问题。大文件上传报错

java.lang.RuntimeException: java.net.SocketTimeoutException

        at com.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequ

est.java:126)

        at com.jfinal.upload.MultipartRequest.<init>(MultipartRequest.java:68)

        at com.jfinal.core.Controller.getFiles(Controller.java:811)

        at com.jfinal.core.Controller.getFile(Controller.java:821)

        at com.crfq.front.controller.VideoController.uploadup(VideoController.ja

va:136)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:483)

        at com.jfinal.aop.Invocation.invoke(Invocation.java:73)

        at com.jfinal.core.ActionHandler.handle(ActionHandler.java:83)

        at com.jfinal.ext.handler.UrlSkipHandler.handle(UrlSkipHandler.java:46)

        at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:239)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:206)

        at org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern

al(CharacterEncodingFilter.java:197)

        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR

equestFilter.java:107)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:239)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:206)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV

alve.java:219)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV

alve.java:106)

        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica

torBase.java:502)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j

ava:142)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j

ava:79)


评论区

JFinal

2019-01-09 16:28

异常 cause 部分呢?

小白菜的天下1

2019-01-14 10:50

@JFinal 问题很是奇怪,我客户端模拟的话。能上传速度也还行。但是移动端的哥们一上传速度慢老是报超时。不知道是不是他自己框架的问题。后来就调整了一下策略。用了servlet做文件上传,速度就ok了

JFinal

2019-01-14 11:12

@小白菜的天下1 这个问题相当奇怪,我也是头一次听说,建议通过单步调试找到哪里慢了, 定位以后彻底解决才好

zzufish

2019-06-10 18:35

遇到同样问题,在jf2.0的时候,没出现过!
Caused by: com.oreilly.servlet.multipart.ExceededSizeException: Posted content length of 22337181 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)
... 46 more

zzufish

2019-06-10 19:00

me.setMaxPostSize(104857600);//文件上传限制100M 100×1024×1024

JFinal

2019-06-10 22:45

@zzufish 看上去是 me.setMaxPostSize(...) 配置没生效,看是不是 eclipse 的自动编译没打开,按理说是可以的

单步调试一下看看