2014-03-26 82 views
0

當我嘗試上傳使用我的服務器的Internet協議的文件時,上傳文件到服務器上時出現問題。它工作正常,但當我試圖從我的域名上傳相同的文件。它不工作。通過服務器ip上傳文件但不通過域名上傳

我的應用程序部署在Linux機器上的Apache tomcat 7.0上。

server.xml中

<Connector port="8080" protocol="HTTP/1.1" 
      connectionUploadTimeout="36000000" 
      disableUploadTimeout="false" 
      connectionTimeout="6000000" 
      maxPostSize="0" 
      redirectPort="8443" 
      /> 

**

org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly 
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367) 
    at org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest.parseRequest(JakartaMultiPartRequest.java:145) 
    at org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest.processUpload(JakartaMultiPartRequest.java:88) 
    at org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest.parse(JakartaMultiPartRequest.java:80) 
    at org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper.<init>(MultiPartRequestWrapper.java:75) 
    at org.apache.struts2.dispatcher.Dispatcher.wrapRequest(Dispatcher.java:709) 
    at org.apache.struts2.dispatcher.ng.PrepareOperations.wrapRequest(PrepareOperations.java:131) 
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:83) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) 
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) 
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200) 
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) 
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:724) 
Caused by: org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly 
    at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:983) 
    at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887) 
    at java.io.InputStream.read(InputStream.java:101) 
    at org.apache.commons.fileupload.util.Streams.copy(Streams.java:94) 
    at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64) 
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362) 
    ... 23 more 

Mar 25, 2014 1:20:07 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 
WARNING: Processing of multipart/form-data request failed. Stream ended unexpectedly 
+0

請分享你得到什麼錯誤。 – Vishrant

+0

我越來越意外地結束了流,請看看堆棧跟蹤.. – user3321738

+0

它是完美的工作,如果我嘗試上傳使用服務器IP像222.22.22.22:8080/myapp – user3321738

回答