Hi,

Tapestry-upload is becoming a problem, maybe it was due to my ignorance of
this component, here is the situation:

My app works very well in a local area network, but when deployed in the
Internet, frequent time out errors pop up, there are times you see it in the
log, and times it just dump the entire Tomcat 6's default HTTP Status 500 -
report to the browser screen like the error I quoted below, I got two
questions:

1) How to catch this time out exception in a page? I have tried many ways,
seems not way to handle this situation, if no way, then it will be very
difficult to use Tapestry-Upload.

2) Is there alternative approach to handle file upload in Tapestry?

Thanks,


 



Angelo Chen wrote:
> 
> Hi Josh,
> 
> here is the exception, happens often when file is a little big, say around
> 900k, the message is a little lengthy, sorry for that:
> 
> HTTP Status 500 -
> 
> type Exception report
> 
> message
> 
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
> 
> exception
> 
> java.lang.RuntimeException: Unable to decode multipart encoded request.
> 
> org.apache.tapestry5.upload.internal.services.MultipartDecoderImpl.parseRequest(MultipartDecoderImpl.java:100)
> 
> org.apache.tapestry5.upload.internal.services.MultipartDecoderImpl.decode(MultipartDecoderImpl.java:78)
>       $MultipartDecoder_11b110b3be8.decode($MultipartDecoder_11b110b3be8.java)
>       $MultipartDecoder_11b110b3a04.decode($MultipartDecoder_11b110b3a04.java)
> 
> org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:41)
> 
> $HttpServletRequestHandler_11b110b3a07.service($HttpServletRequestHandler_11b110b3a07.java)
> 
> org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
> 
> $HttpServletRequestFilter_11b110b3a05.service($HttpServletRequestFilter_11b110b3a05.java)
> 
> $HttpServletRequestHandler_11b110b3a07.service($HttpServletRequestHandler_11b110b3a07.java)
> 
> $HttpServletRequestHandler_11b110b3a03.service($HttpServletRequestHandler_11b110b3a03.java)
>       org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:168)
> 
> root cause
> 
> org.apache.commons.fileupload.FileUploadBase$IOFileUploadException:
> Processing of multipart/form-data request failed. Read timed out
> 
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:359)
> 
> org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
> 
> org.apache.tapestry5.upload.internal.services.MultipartDecoderImpl.parseRequest(MultipartDecoderImpl.java:96)
> 
> org.apache.tapestry5.upload.internal.services.MultipartDecoderImpl.decode(MultipartDecoderImpl.java:78)
>       $MultipartDecoder_11b110b3be8.decode($MultipartDecoder_11b110b3be8.java)
>       $MultipartDecoder_11b110b3a04.decode($MultipartDecoder_11b110b3a04.java)
> 
> org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:41)
> 
> $HttpServletRequestHandler_11b110b3a07.service($HttpServletRequestHandler_11b110b3a07.java)
> 
> org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
> 
> $HttpServletRequestFilter_11b110b3a05.service($HttpServletRequestFilter_11b110b3a05.java)
> 
> $HttpServletRequestHandler_11b110b3a07.service($HttpServletRequestHandler_11b110b3a07.java)
> 
> $HttpServletRequestHandler_11b110b3a03.service($HttpServletRequestHandler_11b110b3a03.java)
>       org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:168)
> 
> root cause
> 
> java.net.SocketTimeoutException: Read timed out
>       java.net.SocketInputStream.socketRead0(Native Method)
>       java.net.SocketInputStream.read(SocketInputStream.java:129)
> 
> org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:716)
> 
> org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:746)
> 
> org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)
> 
> org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:675)
>       org.apache.coyote.Request.doRead(Request.java:428)
> 
> org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:298)
>       org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405)
>       org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:313)
> 
> org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)
> 
> org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:959)
> 
> org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887)
>       java.io.InputStream.read(InputStream.java:89)
>       org.apache.commons.fileupload.util.Streams.copy(Streams.java:94)
>       org.apache.commons.fileupload.util.Streams.copy(Streams.java:64)
> 
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:354)
> 
> org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
> 
> org.apache.tapestry5.upload.internal.services.MultipartDecoderImpl.parseRequest(MultipartDecoderImpl.java:96)
> 
> org.apache.tapestry5.upload.internal.services.MultipartDecoderImpl.decode(MultipartDecoderImpl.java:78)
>       $MultipartDecoder_11b110b3be8.decode($MultipartDecoder_11b110b3be8.java)
>       $MultipartDecoder_11b110b3a04.decode($MultipartDecoder_11b110b3a04.java)
> 
> org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:41)
> 
> $HttpServletRequestHandler_11b110b3a07.service($HttpServletRequestHandler_11b110b3a07.java)
> 
> org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
> 
> $HttpServletRequestFilter_11b110b3a05.service($HttpServletRequestFilter_11b110b3a05.java)
> 
> $HttpServletRequestHandler_11b110b3a07.service($HttpServletRequestHandler_11b110b3a07.java)
> 
> $HttpServletRequestHandler_11b110b3a03.service($HttpServletRequestHandler_11b110b3a03.java)
>       org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:168)
> 
> 
> 
> joshcanfield wrote:
>> 
>> Hey Angelo,
>> 
>> It'd be helpful to see the exception that you're talking about.
>> 
>> Josh
>> 
>> On Thu, Jul 10, 2008 at 12:11 AM, Angelo Chen
>> <[EMAIL PROTECTED]>
>> wrote:
>> 
>>>
>>> Hi,
>>>
>>> probably I did not make my original question clear, the UploadExample
>>> works,
>>> however, there are situations that we got a time out exception, how to
>>> track
>>> this exception in the following example? thanks for the help,
>>>
>>> Angelo
>>>
>>>
>>> Angelo Chen wrote:
>>> >
>>> > Hi,
>>> >
>>> > following sample works, but how to determine if timeout error occurs?
>>> > thanks.
>>> >
>>> >  public class UploadExample
>>> >     {
>>> >         private UploadedFile file;
>>> >
>>> >         public UploadedFile getFile()
>>> >         {
>>> >             return file;
>>> >         }
>>> >
>>> >         public void setFile(UploadedFile file)
>>> >         {
>>> >             this.file = file;
>>> >         }
>>> >
>>> >         public void onSuccess()
>>> >         {
>>> >             File copied = new File("/my/file/location/" +
>>> > file.getFileName());
>>> >
>>> >             file.write(copied);
>>> >         }
>>> >     }
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/T5%3A-FileUpload-and-time-out-tp18355064p18377198.html
>>>  Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>> 
>> 
>> -- 
>> --
>> TheDailyTube.com. Sign up and get the best new videos on the internet
>> delivered fresh to your inbox.
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-FileUpload-and-time-out-tp18355064p18460488.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to