WAS 8.5中的文件上传无效

时间:2017-02-08 12:22:36

标签: java spring websphere multipart apache-commons-fileupload

我正在尝试从外部应用程序上传一个文件,它在Spring中开发,并使用apache commons-fileupload-1.2.1.jar进行Multipart文件上传。 早些时候文件上传曾经工作但突然停止了。我将调试指向WAS并尝试调试应用程序,设置文件的方法在

之下
@ResponseBody ActionResult uploadFile(TaskStatusBean command,BindingResult result, HttpServletRequest request)

无法提供有关安全原因的方法的进一步信息

将文件设置在命令对象中,稍后我们使用下面的调用

进行检索
MultipartFile file = command.getFile();

毫无疑问它在tomcat中运行得很好,但似乎这个command.getFile()语句在websphere中给出了null对象。以下是我在 SystemOut.log

中获得的日志
  

************开始显示当前环境************

WebSphere Platform 8.5.0.0 [BASE 8.5.0.0 gm1218.01]
Host Operating System is Linux, version 3.10.0-121.el7.x86_64
Java version = 1.6.0, Java Compiler = j9jit26, Java VM name = IBM J9 VM
was.install.root = 
user.install.root = 
Java Home = /data1/IBM/WebSphere/AppServer/java/jre
Orb Version = IBM Java ORB build orb626-20120304.00
************* End Display Current Environment *************
     

[2/8/17 16:50:31:531 IST] 000000ca webapp E
  com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E:   [Servlet错误] - [springDispatcher]:   java.lang.IllegalStateException:SRVE0209E:Writer已经   获得了   com.ibm.ws.webcontainer.srt.SRTServletResponse.getOutputStream(SRTServletResponse.java:743)   在   org.owasp.csrfguard.http.MutableHttpResponse.writeContent(MutableHttpResponse.java:99)     在   org.owasp.csrfguard.CSRFGuardFilter.doFilter(CSRFGuardFilter.java:73)     在   com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)     在   com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)     在   org.springframework.web.multipart.support.MultipartFilter.doFilterInternal(MultipartFilter.java:119)     在   org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)     在   com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)     在   com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)     在   org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)     在   org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)   在   com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)   在   com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)   在   com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:926)     在   com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1023)     在   com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3703)     在   com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)     在   com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:962)     在   com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)     在   com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)     在   com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)     在   com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:522)     在   com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:311)     在   com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:87)     在   com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)     在   com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)     在   com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)     在com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)at at   com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)at at   com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)     在com.ibm.io.async.ResultHandler $ 2.run(ResultHandler.java:905)at   com.ibm.ws.util.ThreadPool $ Worker.run(ThreadPool.java:1783)

     

[2/8/17 16:50:31:559 IST] 000000ca webapp E.   com.ibm.ws.webcontainer.webapp.WebApp reportRecursiveError错误页面   例外:[2/8/17 16:50:31:981 IST] 000000b8 WSCallHelper I
  调用getNativeConnection [2/8/17 16:50:33:731 IST] 000000a9 srt
  W com.ibm.ws.webcontainer.srt.SRTServletResponse setIntHeader   SRVE8094W:警告:无法设置标题。响应已经提交。

任何帮助表示赞赏。我无法摆脱这个问题。 提前致谢

此致 相同

0 个答案:

没有答案