• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: problem with WOFileUpload
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with WOFileUpload


  • Subject: Re: problem with WOFileUpload
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 22 Mar 2006 19:38:40 -0800

Hi,

On Mar 22, 2006, at 11:16 AM, Jean-François Veillette wrote:

Situation :
We have an application where users can submit files to the system. We use WOFileUpload to stream the file directly to the disk.
There is at least 500 files uploaded per day (up to 1000), counting for something between 100Mb and 150Mb of data.


Problem :
Every day, we get about 2 to 5 upload that fails with :
Error writing to output stream: java.io.FileOutputStream@6de8a7
java.io.IOException: Connection reset by peer: Amount read didn't match content-length


I have seen that a lot in my applications that do uploads and I had always thought it was the user clicking stop, closing the browser, network interruptions of the upload stream etc.


And at that point, we are looking for tips on where/what to look to fix the problem.

Here is the Stack on one such problem :
java.lang.RuntimeException: Error writing to output stream:
java.io.FileOutputStream@6de8a7
java.io.IOException: Connection reset by peer: Amount read didn't match content-length
at com.webobjects.appserver._private.WOFileUpload.takeValuesFromRequest (WOFileUpload.java:271)
at com.webobjects.appserver._private.WODynamicGroup.takeChildrenValuesFro mRequest(WODynamicGroup.java:81)
at com.webobjects.appserver._private.WODynamicGroup.takeValuesFromRequest (WODynamicGroup.java:89)
at com.webobjects.appserver._private.WOConditional.takeValuesFromRequest( WOConditional.java:41)
at com.webobjects.appserver._private.WODynamicGroup.takeChildrenValuesFro mRequest(WODynamicGroup.java:81)
...


Server configuration :
On this server, we run both apache 1.x and multiples wo applications (multiple application and multiple instances) : WO5.2.3 / Apache 1.x / MacOS-X 10.3.9.


My own impression :
We can reproduce the problem when 2 sessions (one Mac/FireFox, one PC/IE) tries to upload a file (less than 1 mb each). After a couple of successful tries (up to 3) we where able to generate the error.

That is interesting. It seems to rule out my assumptions above. The "java.io.IOException: Connection reset by peer" part does make it look as if the app sees a truncated stream.


Does it happen for both browsers or only IE or only FireFox? It is probably worth putting a proxy between the browser and the app to see what is getting sent / received.


So this lead me to think about a thread/race condition problem either on the apache-wo adaptor or in the application implementation about file upload.

The requests to Apache should be dispatched in their own thread and the requests into the application are also dispatched into their own thread. I can't think of where the problem would be in the application side. I don't know Apache architecture very well. It could be that there is a race condition when two upload streams come in at once.


Chuck

--
Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro


Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects




_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: problem with WOFileUpload
      • From: Jean-François Veillette <email@hidden>
References: 
 >problem with WOFileUpload (From: Jean-François Veillette <email@hidden>)

  • Prev by Date: Re: Static versus non-Static methods?
  • Next by Date: WOLips requirement problem on Intel
  • Previous by thread: problem with WOFileUpload
  • Next by thread: Re: problem with WOFileUpload
  • Index(es):
    • Date
    • Thread