jfinal.upload.MultipartRequest.wraMultipartRequest问题

波总:发布在Windows2008中的glassfish中是没问题的,但是发布在linux的glassfish上就有问题,两个服务器的glassfish还有jdk是一样的版本,求解。

[ERROR]-[Thread: http-listener-1(3)]-[com.jfinal.core.ActionHandler.handle()]: /base/imageUpload

java.lang.RuntimeException: java.io.IOException: Corrupt form data: premature ending

at com.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequest.java:124)

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

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

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

at com.pansoft.esppc.action.BasePcController.imageUpload(BasePcController.java:1292)

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

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

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.pansoft.esppc.interceptor.LoginInter.intercept(LoginInter.java:16)

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

at com.pansoft.esppc.interceptor.LoggerInter.intercept(LoggerInter.java:24)

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

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

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

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)

at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)

at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)

at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)

at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)

at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)

at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)

at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)

at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)

at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)

at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)

at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)

at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)

at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)

at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)

at java.lang.Thread.run(Thread.java:745)

Caused by: java.io.IOException: Corrupt form data: premature ending

at com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:207)

at com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:223)

at com.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequest.java:107)

... 44 more]]

评论区

JFinal

2017-04-07 21:29

上传数据时的格式没有遵守 http 规范而已,参考这里的贴子:http://www.jfinal.com/feedback/694

dogu

2017-04-08 11:30

@JFinal 谢谢波总,找到问题了:用ajaxflieupload上传文件的时候加上:type : "post",就可以了,但是还有一点不明白:为啥tomcat就没这种问题QAQ

JFinal

2017-04-08 11:38

@dogu 有可能是 ajaxfileupload 的 bug

热门反馈

扫码入社