JFinal

登录 注册

文件上传异常 unexpected end of part

问题1:
2017-09-12 09:51:34
[DEBUG]-[Thread: http-bio-8081-exec-7047]-[com.jfinal.kit.LogKit.debug()]: 已拦截
java.lang.RuntimeException: java.io.IOException: unexpected end of part
	at com.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequest.java:126)
	at com.jfinal.upload.MultipartRequest.<init>(MultipartRequest.java:68)
	at com.jfinal.core.Controller.getFiles(Controller.java:775)
	at com.jfinal.core.Controller.getFile(Controller.java:780)
	at com.yuminsoft.cps.pic.api.file.FileDataController.upload(FileDataController.java:105)
	at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
	at com.jfinal.validate.Validator.intercept(Validator.java:86)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.jfinal.validate.Validator.intercept(Validator.java:86)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.yuminsoft.cps.pic.api.common.ApiInterceptor.intercept(ApiInterceptor.java:37)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.yuminsoft.cps.pic.common.interceptor.AuthInterceptor.intercept(AuthInterceptor.java:26)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.yuminsoft.cps.pic.common.interceptor.ExceptionGlobalInterceptor.intercept(ExceptionGlobalInterceptor.java:29)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:82)
	at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:48)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: unexpected end of part
	at com.oreilly.servlet.multipart.PartInputStream.fill(PartInputStream.java:100)
	at com.oreilly.servlet.multipart.PartInputStream.read(PartInputStream.java:195)
	at com.oreilly.servlet.multipart.PartInputStream.read(PartInputStream.java:156)
	at com.oreilly.servlet.multipart.FilePart.write(FilePart.java:208)
	at com.oreilly.servlet.multipart.FilePart.writeTo(FilePart.java:167)
	at com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:272)
	at com.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequest.java:107)
	... 38 more

主要是图片上传,FileDataController.java:105代码

pic1.jpg

问题2:

2017-09-12 10:37:26
[DEBUG]-[Thread: http-bio-8081-exec-7114]-[com.jfinal.kit.LogKit.debug()]: 已拦截
java.lang.RuntimeException: java.net.SocketTimeoutException: Read timed out
	at com.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequest.java:126)
	at com.jfinal.upload.MultipartRequest.<init>(MultipartRequest.java:68)
	at com.jfinal.core.Controller.getFiles(Controller.java:775)
	at com.jfinal.core.Controller.getFile(Controller.java:780)
	at com.yuminsoft.cps.pic.api.file.FileDataController.upload(FileDataController.java:105)
	at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
	at com.jfinal.validate.Validator.intercept(Validator.java:86)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.jfinal.validate.Validator.intercept(Validator.java:86)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.yuminsoft.cps.pic.api.common.ApiInterceptor.intercept(ApiInterceptor.java:37)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.yuminsoft.cps.pic.common.interceptor.AuthInterceptor.intercept(AuthInterceptor.java:26)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.yuminsoft.cps.pic.common.interceptor.ExceptionGlobalInterceptor.intercept(ExceptionGlobalInterceptor.java:29)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:82)
	at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:48)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:152)
	at java.net.SocketInputStream.read(SocketInputStream.java:122)
	at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:535)
	at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:504)
	at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:566)
	at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:137)
	at org.apache.coyote.http11.AbstractInputBuffer.doRead(AbstractInputBuffer.java:287)
	at org.apache.coyote.Request.doRead(Request.java:438)
	at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:290)
	at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:449)
	at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:315)
	at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:200)
	at com.oreilly.servlet.multipart.BufferedServletInputStream.fill(BufferedServletInputStream.java:64)
	at com.oreilly.servlet.multipart.BufferedServletInputStream.readLine(BufferedServletInputStream.java:108)
	at com.oreilly.servlet.multipart.LimitedServletInputStream.readLine(LimitedServletInputStream.java:60)
	at com.oreilly.servlet.multipart.PartInputStream.fill(PartInputStream.java:97)
	at com.oreilly.servlet.multipart.PartInputStream.read(PartInputStream.java:183)
	at com.oreilly.servlet.multipart.PartInputStream.read(PartInputStream.java:156)
	at com.oreilly.servlet.multipart.FilePart.write(FilePart.java:208)
	at com.oreilly.servlet.multipart.FilePart.writeTo(FilePart.java:167)
	at com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:272)
	at com.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequest.java:107)
	... 38 more

最后直接拖死系统,

2017-09-12 16:45:44
[DEBUG]-[Thread: http-bio-8081-exec-8152]-[com.jfinal.kit.LogKit.debug()]: 已拦截
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.jfinal.aop.Invocation.invoke(Invocation.java:87)
	at com.jfinal.validate.Validator.intercept(Validator.java:86)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.jfinal.validate.Validator.intercept(Validator.java:86)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.yuminsoft.cps.pic.api.common.ApiInterceptor.intercept(ApiInterceptor.java:37)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.yuminsoft.cps.pic.common.interceptor.AuthInterceptor.intercept(AuthInterceptor.java:26)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.yuminsoft.cps.pic.common.interceptor.ExceptionGlobalInterceptor.intercept(ExceptionGlobalInterceptor.java:29)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:82)
	at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:48)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
	... 30 more
Caused by: java.lang.OutOfMemoryError: Java heap space


ApiInterceptor.java

pic2.jpg

AuthInterceptor.java

pic3.jpg

ExceptionGlobalInterceptor.java

pic4.jpg

评论