RE: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-19 Thread Alten, Jessica-Aileen
> We have used HTTP Analayzer for file upload via Internet Explorer-8.
> Following are the scenario observed. [...]

I've just came back from vacation and didn't followed the whole thread - but I 
think it is simply an IE 8 problem, see 
http://blogs.msdn.com/b/ieinternals/archive/2011/03/10/wininet-internet-explorer-file-download-and-upload-maximum-size-limits.aspx

IE 8 can't upload more than 2 GB.

Greetings
Jessica


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-19 Thread Rahul Singh
Apart from below information, one additional information.

We have used the jQuery form plugin js in our project. This handles the form 
and request submit. The code is as attached here.





From: Rahul Singh <rksing...@hotmail.com>
Sent: Tuesday, January 19, 2016 11:30 AM
To: Tomcat Users List
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

Hi Christopher ,


>>So... what makes you sure that the browser actually made the request?
>>I'd like to see some kind of confirmation using a tool you didn't
>>write. Perhaps something like Firebug, LiveHttpHeaders, Fiddler, or
>>even Wireshark showing that the request was made, what headers it had,
>>etc.

OK,
We have used HTTP Analayzer for file upload via Internet Explorer-8. Following 
are the scenario observed.

For lesser than 2gb file uploads : The request header shows the correct 
content-length value of the file.The uploads works fine further also.

For more than 2gb file uploads: The file length is 2151533567 bytes(which is 
roughly 2.15 Gb).  The request is aborted in this case and the request header 
shows the content length
as -214343325 bytes (which is rougly 214 Mb).The upload process does not 
proceed further in this case.

both cases request headers are attached in screenshot.

From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Monday, January 18, 2016 11:17 AM
To: Tomcat Users List
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rahul,

On 1/17/16 11:28 PM, Rahul Singh wrote:
> Code flow is attached, forgot to attach in trailing mail.
>
> --
- --
>
>
*From:* Rahul Singh <rksing...@hotmail.com>
> *Sent:* Monday, January 18, 2016 8:39 AM *To:* Tomcat Users List
> *Subject:* Re: File size >= 2GB not uploaded in application
> [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]
>
> Hello Christopher, thanks for your prompt response !!
>
>> Why didn't you come to the Tomcat community first?
> Sorry for the delay, we wanted to make sure about the component
> causing the problem.
>
>
>>> I don't have a test-case in front of me, but I'm fairly
>>> confident that Tomcat allows file uploads of greater than 2GiB.
>>> I suspect the problem
> is another component.
>>> Are you using Servlet 3.0-based file upload, or are you
>>> allowing Struts to handle the file-upload for you? If you use
>>> Servlet-3.0 file-upload, then you'll have code that deals with
>>> Multipart classes and configuration in web.xml. If you are
>>> using Struts's file-upload, then you'll mostly just be calling
>>> getFile or getInputStream or however Struts 2 does things (I
>>> can't remember how it all works off the top of my head).
>
>
> In our case the filter class implements the javax.servlet.flter
> and imports javax.servlet.* The Filter class mentioned in the
> previous threads is the first one as declared in the web.xml
> (followed by other struts filters). All (url) requests are mapped
> to this filter. So this is where our file upload request goes. It
> is only in greater than 2 gb file upload request that the
> dofilter() fails to get any request. So we feel servlet 3.0 being
> used in our case the Filter is not being able to handle greater
> than 2 gb requests.
>
>
>>> The point is, if you are using Struts, then Tomcat will not
>>> touch the request and Struts is handling the whole thing. If
>>> Struts is the problem, you'll need to talk to the Struts
>>> team[1].
>
>>> If you are using Servlet-3.0 file-upload, then Struts is just a
>>> red herring and this is the right place to get your issue
>>> solved.
>
> As mentioned above Servlet 3.0 is being used. So request the
> tomcat community to please look into our issue.
>
>>> So far, you have posted some configuration for Struts and some
>>> JSP tablib-filled code, plus some Java code for a Filter. You
>>> didn't say where the Filter was in the filter chain (before or
>>> after Struts filter). You also mentioned that the form is
>>> actually posted using XMLHttpRequest and not through a standard
>>> form, but you didn't explain what component is doing that or
>>> how it actually works.
>
>>> There isn't enough information here to make any sense of the
>>> situation. Can you please address all of the questions I've
>>> posed above and maybe we can then help you?
>
>
> <<>>

Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rahul,

On 1/19/16 1:00 AM, Rahul Singh wrote:
>>> So... what makes you sure that the browser actually made the
>>> request? I'd like to see some kind of confirmation using a tool
>>> you didn't write. Perhaps something like Firebug,
>>> LiveHttpHeaders, Fiddler, or even Wireshark showing that the
>>> request was made, what headers it had, etc.
> 
> OK, We have used HTTP Analayzer for file upload via Internet
> Explorer-8. Following are the scenario observed.

Support for MSIE 8 has been dropped worldwide unless you have an
expensive support contract.

> For lesser than 2gb file uploads : The request header shows the 
> correct content-length value of the file. The uploads works fine 
> further also.
> 
> For more than 2gb file uploads: The file length is 2151533567 
> bytes(which is roughly 2.15 Gb). The request is aborted in this
> case and the request header shows the content length as -214343325
> bytes (which is rougly 214 Mb).

The request-header as reported by what? The HTTP analyzer?

- -214343325 is not 214MiB. It's an invalid (negative) size. If you were
to take the absolute value of it and call it a size, it would be ~204MiB
.

> The upload process does not proceed further in this case.

Does the request make it to the Tomcat server?

HTTP defines the Content-Length as a series of one or more digits. No
negatives are allowed. If Tomcat is being spec-pedantic (and I hope it
is), it will treat a negative number as invalid and default to zero
(bytes).

https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

> both cases request headers are attached in screenshot.

Non-text attachments are stripped from this list. There was no attachmen
t.

Jessica-Aileen has also replied stating that MSIE8 does not support
file uploads greater than 2GiB.

I think the case is closed, here.

Thanks,
- -chris


>  From: Christopher Schultz
> <ch...@christopherschultz.net> Sent: Monday, January 18, 2016 11:17
> AM To: Tomcat Users List Subject: Re: File size >= 2GB not uploaded
> in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]
> 
> Rahul,
> 
> On 1/17/16 11:28 PM, Rahul Singh wrote:
>> Code flow is attached, forgot to attach in trailing mail.
> 
>> -
- -
>
>> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 
> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlaeWpIACgkQ9CaO5/Lv0PA6fQCgkS8CZwtxPNuzZCZTaAX8X+69
Mi4AoJC7IMWtk6YrJTuekY8zr9viInQk
=jekN
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-18 Thread Kiran Badi
Hi Chris,

Ok but I had bunch of similar issues with file upload when I had done with
struts 2 and plain J2ee. So thought worth checking.

Maybe JavaScript part might be culprit or  form data of JS might have some
limit on size.and file upload via JS is supported only in last couple of
years.Older browsers relied iframe for uploads.

Yes without all the info it's hard to tell anything for sure.

On Monday, January 18, 2016, Joleen Barker  wrote:

> I am not positive, but I thought the older browsers had a 2GB limit. The
> company I worked for ran in to a similar problem and it was the result of
> the browser. I think Chrome didn't have the issue and IE did. We ended up
> making a note in the Known Issues of the manual about the limitation. This
> is going back awhile though.
>
> -Joleen
>
> On Mon, Jan 18, 2016 at 7:40 AM, Christopher Schultz <
> ch...@christopherschultz.net > wrote:
>
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > Kiran,
> >
> > On 1/18/16 1:33 AM, Kiran Badi wrote:
> > > Did you exclude your upload servlet from struts.xml ? By default
> > > struts intercepts all multi part requests and this messes a lot
> > > specially when you have hybrid framework when few modules are plain
> > > j2ee and few are struts 2 or Spring MVc in the same app.
> >
> > OP states that the Filter is placed before Struts. Struts's
> > interceptors fire from within Struts's Filter, so that shouldn't be a
> > problem.
> >
> > > Are you upload less than 2gb file ?
> >
> > I think, ultimately, this is going to be a problem with Javascript,
> > the browser (as yet unnamed), or the OP's code.
> >
> > - -chris
> > -BEGIN PGP SIGNATURE-
> > Comment: GPGTools - http://gpgtools.org
> > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> >
> > iEYEARECAAYFAlac3UcACgkQ9CaO5/Lv0PDFZQCfRt5WfvmP48UwxfM23FP0l0Uz
> > 1AYAn15i3dRPe7d7nVpEU69VW66eyQnQ
> > =d1St
> > -END PGP SIGNATURE-
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> 
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> >
> >
>


Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kiran,

On 1/18/16 1:33 AM, Kiran Badi wrote:
> Did you exclude your upload servlet from struts.xml ? By default
> struts intercepts all multi part requests and this messes a lot
> specially when you have hybrid framework when few modules are plain
> j2ee and few are struts 2 or Spring MVc in the same app.

OP states that the Filter is placed before Struts. Struts's
interceptors fire from within Struts's Filter, so that shouldn't be a
problem.

> Are you upload less than 2gb file ?

I think, ultimately, this is going to be a problem with Javascript,
the browser (as yet unnamed), or the OP's code.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlac3UcACgkQ9CaO5/Lv0PDFZQCfRt5WfvmP48UwxfM23FP0l0Uz
1AYAn15i3dRPe7d7nVpEU69VW66eyQnQ
=d1St
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-18 Thread Joleen Barker
I am not positive, but I thought the older browsers had a 2GB limit. The
company I worked for ran in to a similar problem and it was the result of
the browser. I think Chrome didn't have the issue and IE did. We ended up
making a note in the Known Issues of the manual about the limitation. This
is going back awhile though.

-Joleen

On Mon, Jan 18, 2016 at 7:40 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Kiran,
>
> On 1/18/16 1:33 AM, Kiran Badi wrote:
> > Did you exclude your upload servlet from struts.xml ? By default
> > struts intercepts all multi part requests and this messes a lot
> > specially when you have hybrid framework when few modules are plain
> > j2ee and few are struts 2 or Spring MVc in the same app.
>
> OP states that the Filter is placed before Struts. Struts's
> interceptors fire from within Struts's Filter, so that shouldn't be a
> problem.
>
> > Are you upload less than 2gb file ?
>
> I think, ultimately, this is going to be a problem with Javascript,
> the browser (as yet unnamed), or the OP's code.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iEYEARECAAYFAlac3UcACgkQ9CaO5/Lv0PDFZQCfRt5WfvmP48UwxfM23FP0l0Uz
> 1AYAn15i3dRPe7d7nVpEU69VW66eyQnQ
> =d1St
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-18 Thread Rahul Singh
Hi Christopher ,


>>So... what makes you sure that the browser actually made the request?
>>I'd like to see some kind of confirmation using a tool you didn't
>>write. Perhaps something like Firebug, LiveHttpHeaders, Fiddler, or
>>even Wireshark showing that the request was made, what headers it had,
>>etc.

OK,
We have used HTTP Analayzer for file upload via Internet Explorer-8. Following 
are the scenario observed.

For lesser than 2gb file uploads : The request header shows the correct 
content-length value of the file.The uploads works fine further also.

For more than 2gb file uploads: The file length is 2151533567 bytes(which is 
roughly 2.15 Gb).  The request is aborted in this case and the request header 
shows the content length 
as -214343325 bytes (which is rougly 214 Mb).The upload process does not 
proceed further in this case.

both cases request headers are attached in screenshot.

From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Monday, January 18, 2016 11:17 AM
To: Tomcat Users List
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rahul,

On 1/17/16 11:28 PM, Rahul Singh wrote:
> Code flow is attached, forgot to attach in trailing mail.
>
> --
- --
>
>
*From:* Rahul Singh <rksing...@hotmail.com>
> *Sent:* Monday, January 18, 2016 8:39 AM *To:* Tomcat Users List
> *Subject:* Re: File size >= 2GB not uploaded in application
> [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]
>
> Hello Christopher, thanks for your prompt response !!
>
>> Why didn't you come to the Tomcat community first?
> Sorry for the delay, we wanted to make sure about the component
> causing the problem.
>
>
>>> I don't have a test-case in front of me, but I'm fairly
>>> confident that Tomcat allows file uploads of greater than 2GiB.
>>> I suspect the problem
> is another component.
>>> Are you using Servlet 3.0-based file upload, or are you
>>> allowing Struts to handle the file-upload for you? If you use
>>> Servlet-3.0 file-upload, then you'll have code that deals with
>>> Multipart classes and configuration in web.xml. If you are
>>> using Struts's file-upload, then you'll mostly just be calling
>>> getFile or getInputStream or however Struts 2 does things (I
>>> can't remember how it all works off the top of my head).
>
>
> In our case the filter class implements the javax.servlet.flter
> and imports javax.servlet.* The Filter class mentioned in the
> previous threads is the first one as declared in the web.xml
> (followed by other struts filters). All (url) requests are mapped
> to this filter. So this is where our file upload request goes. It
> is only in greater than 2 gb file upload request that the
> dofilter() fails to get any request. So we feel servlet 3.0 being
> used in our case the Filter is not being able to handle greater
> than 2 gb requests.
>
>
>>> The point is, if you are using Struts, then Tomcat will not
>>> touch the request and Struts is handling the whole thing. If
>>> Struts is the problem, you'll need to talk to the Struts
>>> team[1].
>
>>> If you are using Servlet-3.0 file-upload, then Struts is just a
>>> red herring and this is the right place to get your issue
>>> solved.
>
> As mentioned above Servlet 3.0 is being used. So request the
> tomcat community to please look into our issue.
>
>>> So far, you have posted some configuration for Struts and some
>>> JSP tablib-filled code, plus some Java code for a Filter. You
>>> didn't say where the Filter was in the filter chain (before or
>>> after Struts filter). You also mentioned that the form is
>>> actually posted using XMLHttpRequest and not through a standard
>>> form, but you didn't explain what component is doing that or
>>> how it actually works.
>
>>> There isn't enough information here to make any sense of the
>>> situation. Can you please address all of the questions I've
>>> posed above and maybe we can then help you?
>
>
> <<>>> We need to model the following code to be told:
> jsp submit of the form How the .js submit it further in
> XmlHttpRequest How the Filter is declared How the web.xml is
> declared
>
>
>> Are you sure the request is even made to the server in these
>> cases?What if the Javascript upload component is failing before
>> it even starts?
>
> Yes the request is made in these cases. We have compared the
> scenari

Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rahul,

On 1/17/16 11:28 PM, Rahul Singh wrote:
> Code flow is attached, forgot to attach in trailing mail.
> 
> --
- --
>
> 
*From:* Rahul Singh <rksing...@hotmail.com>
> *Sent:* Monday, January 18, 2016 8:39 AM *To:* Tomcat Users List 
> *Subject:* Re: File size >= 2GB not uploaded in application
> [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]
> 
> Hello Christopher, thanks for your prompt response !!
> 
>> Why didn't you come to the Tomcat community first?
> Sorry for the delay, we wanted to make sure about the component
> causing the problem.
> 
> 
>>> I don't have a test-case in front of me, but I'm fairly
>>> confident that Tomcat allows file uploads of greater than 2GiB.
>>> I suspect the problem
> is another component.
>>> Are you using Servlet 3.0-based file upload, or are you
>>> allowing Struts to handle the file-upload for you? If you use
>>> Servlet-3.0 file-upload, then you'll have code that deals with
>>> Multipart classes and configuration in web.xml. If you are
>>> using Struts's file-upload, then you'll mostly just be calling
>>> getFile or getInputStream or however Struts 2 does things (I
>>> can't remember how it all works off the top of my head).
> 
> 
> In our case the filter class implements the javax.servlet.flter
> and imports javax.servlet.* The Filter class mentioned in the
> previous threads is the first one as declared in the web.xml
> (followed by other struts filters). All (url) requests are mapped
> to this filter. So this is where our file upload request goes. It
> is only in greater than 2 gb file upload request that the
> dofilter() fails to get any request. So we feel servlet 3.0 being
> used in our case the Filter is not being able to handle greater
> than 2 gb requests.
> 
> 
>>> The point is, if you are using Struts, then Tomcat will not
>>> touch the request and Struts is handling the whole thing. If
>>> Struts is the problem, you'll need to talk to the Struts
>>> team[1].
> 
>>> If you are using Servlet-3.0 file-upload, then Struts is just a
>>> red herring and this is the right place to get your issue
>>> solved.
> 
> As mentioned above Servlet 3.0 is being used. So request the
> tomcat community to please look into our issue.
> 
>>> So far, you have posted some configuration for Struts and some
>>> JSP tablib-filled code, plus some Java code for a Filter. You
>>> didn't say where the Filter was in the filter chain (before or
>>> after Struts filter). You also mentioned that the form is
>>> actually posted using XMLHttpRequest and not through a standard
>>> form, but you didn't explain what component is doing that or
>>> how it actually works.
> 
>>> There isn't enough information here to make any sense of the 
>>> situation. Can you please address all of the questions I've
>>> posed above and maybe we can then help you?
> 
> 
> <<>>> We need to model the following code to be told: 
> jsp submit of the form How the .js submit it further in
> XmlHttpRequest How the Filter is declared How the web.xml is
> declared
> 
> 
>> Are you sure the request is even made to the server in these
>> cases?What if the Javascript upload component is failing before
>> it even starts?
> 
> Yes the request is made in these cases. We have compared the
> scenario for greater than 2gb and lesser size file uploads and
> drawn the following inference from it.We have checked the request
> and content length for dofilter() method in our logs. The
> JavaScript is not the culprit in this case. The JavaScript sets the
> AJAX field to success after sending request and thereafter waits
> for response(which is not received in our case). Our application
> works fine for lesser than 2 gb fie uploads but fails for greater
> size files as the request fails to reach the dofilter() method
> after which the request can be forwarded to the requested method.
> 
> 
> 
> Regards, Rahul
> 
>  From: Christopher Schultz
> <ch...@christopherschultz.net> Sent: Saturday, January 16, 2016
> 9:33 AM To: Tomcat Users List Subject: Re: File size >= 2GB not
> uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK
> 1.7.79]
> 
> Rahul,
> 
> On 1/15/16 1:02 AM, Rahul Singh wrote:
>> Thanks for your guidelines, we have big hope from Apache Tomcat 
>> Team to solve this problem as this is show stopper for our 
>> application, we have also 

Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-17 Thread Konstantin Kolinko
2016-01-18 6:09 GMT+03:00 Rahul Singh :
>
>>Are you sure the request is even made to the server in these cases?What if 
>>the Javascript upload component is failing before it even starts?
>
> Yes the request is made in these cases. We have compared the scenario for 
> greater than 2gb and lesser size file uploads and drawn the following 
> inference from it.We have checked the request and content length for 
> dofilter() method in our logs. The JavaScript is not the culprit in this 
> case. The JavaScript sets the AJAX field to success after sending request and 
> thereafter waits for response(which is not received in our case). Our 
> application works fine for lesser than 2 gb fie uploads but fails for greater 
> size files as the request fails to reach the dofilter() method after which 
> the request can be forwarded to the requested method.


So you have an evidence that your Javascript method call returned, but
you have no evidence that browser have actually sent the request nor
that the request has reached Tomcat.

You say "the request fails to reach the dofilter() method" so there is
no evidence that the request was received.

Try debugging
https://wiki.apache.org/tomcat/FAQ/Troubleshooting_and_Diagnostics#Common_Troubleshooting_Scenario

Try submitting the file with a simple , without AJAX.


See this thread from archives of this list (August 2012):
http://tomcat.markmail.org/message/32t2glp3nbo2npag


> Struts: 2.3.24

The current version is 2.3.24.1 (released 3 months ago)
http://struts.apache.org/announce.html#a20150924


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-17 Thread Kiran Badi
Did you exclude your upload servlet from struts.xml ? By default struts
intercepts all multi part requests and this messes a lot specially when you
have hybrid framework when few modules are plain j2ee and few are struts 2
or Spring MVc in the same app.

Are you upload less than 2gb file ?

On Monday, January 18, 2016, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Rahul,
>
> On 1/17/16 11:28 PM, Rahul Singh wrote:
> > Code flow is attached, forgot to attach in trailing mail.
> >
> > --
> - --
> >
> >
> *From:* Rahul Singh <rksing...@hotmail.com <javascript:;>>
> > *Sent:* Monday, January 18, 2016 8:39 AM *To:* Tomcat Users List
> > *Subject:* Re: File size >= 2GB not uploaded in application
> > [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]
> >
> > Hello Christopher, thanks for your prompt response !!
> >
> >> Why didn't you come to the Tomcat community first?
> > Sorry for the delay, we wanted to make sure about the component
> > causing the problem.
> >
> >
> >>> I don't have a test-case in front of me, but I'm fairly
> >>> confident that Tomcat allows file uploads of greater than 2GiB.
> >>> I suspect the problem
> > is another component.
> >>> Are you using Servlet 3.0-based file upload, or are you
> >>> allowing Struts to handle the file-upload for you? If you use
> >>> Servlet-3.0 file-upload, then you'll have code that deals with
> >>> Multipart classes and configuration in web.xml. If you are
> >>> using Struts's file-upload, then you'll mostly just be calling
> >>> getFile or getInputStream or however Struts 2 does things (I
> >>> can't remember how it all works off the top of my head).
> >
> >
> > In our case the filter class implements the javax.servlet.flter
> > and imports javax.servlet.* The Filter class mentioned in the
> > previous threads is the first one as declared in the web.xml
> > (followed by other struts filters). All (url) requests are mapped
> > to this filter. So this is where our file upload request goes. It
> > is only in greater than 2 gb file upload request that the
> > dofilter() fails to get any request. So we feel servlet 3.0 being
> > used in our case the Filter is not being able to handle greater
> > than 2 gb requests.
> >
> >
> >>> The point is, if you are using Struts, then Tomcat will not
> >>> touch the request and Struts is handling the whole thing. If
> >>> Struts is the problem, you'll need to talk to the Struts
> >>> team[1].
> >
> >>> If you are using Servlet-3.0 file-upload, then Struts is just a
> >>> red herring and this is the right place to get your issue
> >>> solved.
> >
> > As mentioned above Servlet 3.0 is being used. So request the
> > tomcat community to please look into our issue.
> >
> >>> So far, you have posted some configuration for Struts and some
> >>> JSP tablib-filled code, plus some Java code for a Filter. You
> >>> didn't say where the Filter was in the filter chain (before or
> >>> after Struts filter). You also mentioned that the form is
> >>> actually posted using XMLHttpRequest and not through a standard
> >>> form, but you didn't explain what component is doing that or
> >>> how it actually works.
> >
> >>> There isn't enough information here to make any sense of the
> >>> situation. Can you please address all of the questions I've
> >>> posed above and maybe we can then help you?
> >
> >
> > <<>>> We need to model the following code to be told:
> > jsp submit of the form How the .js submit it further in
> > XmlHttpRequest How the Filter is declared How the web.xml is
> > declared
> >
> >
> >> Are you sure the request is even made to the server in these
> >> cases?What if the Javascript upload component is failing before
> >> it even starts?
> >
> > Yes the request is made in these cases. We have compared the
> > scenario for greater than 2gb and lesser size file uploads and
> > drawn the following inference from it.We have checked the request
> > and content length for dofilter() method in our logs. The
> > JavaScript is not the culprit in this case. The JavaScript sets the
> > AJAX field to success after sending request and thereafter waits
> > for response(which is not rec

Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-17 Thread Rahul Singh
Code flow is attached, forgot to attach in trailing mail.



From: Rahul Singh <rksing...@hotmail.com>
Sent: Monday, January 18, 2016 8:39 AM
To: Tomcat Users List
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

Hello Christopher,
thanks for your prompt response !!

> Why didn't you come to the Tomcat community first?
Sorry for the delay, we wanted to make sure about the component causing the 
problem.


>>I don't have a test-case in front of me, but I'm fairly confident that
>>Tomcat allows file uploads of greater than 2GiB. I suspect the problem
is another component.
>>Are you using Servlet 3.0-based file upload, or are you allowing
>>Struts to handle the file-upload for you? If you use Servlet-3.0
>>file-upload, then you'll have code that deals with Multipart classes
>>and configuration in web.xml. If you are using Struts's file-upload,
>>then you'll mostly just be calling getFile or getInputStream or
>>however Struts 2 does things (I can't remember how it all works off
>>the top of my head).


In our case the filter class implements the javax.servlet.flter and imports 
javax.servlet.*
The Filter class mentioned in the previous threads is the first one as declared 
in the web.xml (followed by other struts filters).
 All (url) requests are mapped to this filter. So this is where our file upload 
request goes. It is only in greater than 2 gb file upload request that the 
dofilter() fails to get any request.
So we feel servlet 3.0 being used in our case the Filter is not being able to 
handle greater than 2 gb requests.


>>The point is, if you are using Struts, then Tomcat will not touch the
>>request and Struts is handling the whole thing. If Struts is the
>>problem, you'll need to talk to the Struts team[1].

>>If you are using Servlet-3.0 file-upload, then Struts is just a red
>>herring and this is the right place to get your issue solved.

As mentioned above Servlet 3.0 is being used. So request the tomcat community 
to please look into our issue.

>>So far, you have posted some configuration for Struts and some JSP
>>tablib-filled code, plus some Java code for a Filter. You didn't say
>>where the Filter was in the filter chain (before or after Struts
>>filter). You also mentioned that the form is actually posted using
>>XMLHttpRequest and not through a standard form, but you didn't explain
>>what component is doing that or how it actually works.

>>There isn't enough information here to make any sense of the
>>situation. Can you please address all of the questions I've posed
>>above and maybe we can then help you?


<<>>> We need to model the following code to be told:
 jsp submit of the form
How the .js submit it further in XmlHttpRequest
How the Filter is declared
How the web.xml is declared


>Are you sure the request is even made to the server in these cases?What if the 
>Javascript upload component is failing before it even starts?

Yes the request is made in these cases. We have compared the scenario for 
greater than 2gb and lesser size file uploads and drawn the following inference 
from it.We have checked the request and content length for dofilter() method in 
our logs. The JavaScript is not the culprit in this case. The JavaScript sets 
the AJAX field to success after sending request and thereafter waits for 
response(which is not received in our case). Our application works fine for 
lesser than 2 gb fie uploads but fails for greater size files as the request 
fails to reach the dofilter() method after which the request can be forwarded 
to the requested method.



Regards,
Rahul

________
From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Saturday, January 16, 2016 9:33 AM
To: Tomcat Users List
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rahul,

On 1/15/16 1:02 AM, Rahul Singh wrote:
> Thanks for your guidelines, we have big hope from Apache Tomcat
> Team to solve this problem as this is show stopper for our
> application, we have also raise this question on various forum like
> stack overflow and other, but no relevant reply till now.

Why didn't you come to the Tomcat community first?

> Hope you understand my situation,
>
> please refer the below stackoverflow reference for more detail
> about this issue.
>
> http://stackoverflow.com/questions/34783438/dofilter-fails-to-get-any-
[http://cdn.sstatic.net/stackoverflow/img/apple-touch-i...@2.png?v=73d79a89bded]<http://stackoverflow.com/questions/34783438/dofilter-fails-to-get-any->

doFilter() fails to get any request for the file upload > 
2gb<http://stacko

Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-17 Thread Rahul Singh
Hello Christopher,
thanks for your prompt response !!

> Why didn't you come to the Tomcat community first?
Sorry for the delay, we wanted to make sure about the component causing the 
problem.


>>I don't have a test-case in front of me, but I'm fairly confident that
>>Tomcat allows file uploads of greater than 2GiB. I suspect the problem
is another component.
>>Are you using Servlet 3.0-based file upload, or are you allowing
>>Struts to handle the file-upload for you? If you use Servlet-3.0
>>file-upload, then you'll have code that deals with Multipart classes
>>and configuration in web.xml. If you are using Struts's file-upload,
>>then you'll mostly just be calling getFile or getInputStream or
>>however Struts 2 does things (I can't remember how it all works off
>>the top of my head).


In our case the filter class implements the javax.servlet.flter and imports 
javax.servlet.* 
The Filter class mentioned in the previous threads is the first one as declared 
in the web.xml (followed by other struts filters).
 All (url) requests are mapped to this filter. So this is where our file upload 
request goes. It is only in greater than 2 gb file upload request that the 
dofilter() fails to get any request.
So we feel servlet 3.0 being used in our case the Filter is not being able to 
handle greater than 2 gb requests.


>>The point is, if you are using Struts, then Tomcat will not touch the
>>request and Struts is handling the whole thing. If Struts is the
>>problem, you'll need to talk to the Struts team[1].

>>If you are using Servlet-3.0 file-upload, then Struts is just a red
>>herring and this is the right place to get your issue solved.

As mentioned above Servlet 3.0 is being used. So request the tomcat community 
to please look into our issue.

>>So far, you have posted some configuration for Struts and some JSP
>>tablib-filled code, plus some Java code for a Filter. You didn't say
>>where the Filter was in the filter chain (before or after Struts
>>filter). You also mentioned that the form is actually posted using
>>XMLHttpRequest and not through a standard form, but you didn't explain
>>what component is doing that or how it actually works.

>>There isn't enough information here to make any sense of the
>>situation. Can you please address all of the questions I've posed
>>above and maybe we can then help you?


<<>>> We need to model the following code to be told: 
 jsp submit of the form
How the .js submit it further in XmlHttpRequest
How the Filter is declared 
How the web.xml is declared


>Are you sure the request is even made to the server in these cases?What if the 
>Javascript upload component is failing before it even starts?

Yes the request is made in these cases. We have compared the scenario for 
greater than 2gb and lesser size file uploads and drawn the following inference 
from it.We have checked the request and content length for dofilter() method in 
our logs. The JavaScript is not the culprit in this case. The JavaScript sets 
the AJAX field to success after sending request and thereafter waits for 
response(which is not received in our case). Our application works fine for 
lesser than 2 gb fie uploads but fails for greater size files as the request 
fails to reach the dofilter() method after which the request can be forwarded 
to the requested method.



Regards,
Rahul 

________
From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Saturday, January 16, 2016 9:33 AM
To: Tomcat Users List
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rahul,

On 1/15/16 1:02 AM, Rahul Singh wrote:
> Thanks for your guidelines, we have big hope from Apache Tomcat
> Team to solve this problem as this is show stopper for our
> application, we have also raise this question on various forum like
> stack overflow and other, but no relevant reply till now.

Why didn't you come to the Tomcat community first?

> Hope you understand my situation,
>
> please refer the below stackoverflow reference for more detail
> about this issue.
>
> http://stackoverflow.com/questions/34783438/dofilter-fails-to-get-any-
request-for-the-file-upload-2gb?noredirect=1#comment57315528_34783438
>
>
>
for more information:
>
> -No error are printed in tomcat logs. - how to configure "call
> HttpServletRequest.getHeader("Content-Length") as a String and
> parse it yourself."

I don't have a test-case in front of my, but I'm fairly confident that
Tomcat allows file uploads of greater than 2GiB. I suspect the problem
is another component.

Are you using Servlet 3.0-based file upload, or are you allowing
Struts to handle the file-upload for you?

Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-15 Thread David kerber

On 1/15/2016 1:02 AM, Rahul Singh wrote:

Dear Christopher,

Thanks for your guidelines, we have big hope from Apache Tomcat Team to solve 
this problem as this is show stopper for our application, we have also raise 
this question on various forum like stack overflow and other,but no relevant 
reply till now.

Hope you understand my situation,

please refer the below stackoverflow reference for more detail about this issue.

http://stackoverflow.com/questions/34783438/dofilter-fails-to-get-any-request-for-the-file-upload-2gb?noredirect=1#comment57315528_34783438


for more information:

  -No error are printed in tomcat logs.
- how to configure "call HttpServletRequest.getHeader("Content-Length") as a String 
and parse it yourself."


This is straight forward java programming that you should be able to 
handle yourself.  It could be done in one line, though I personally 
wouldn't do it that way.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rahul,

On 1/15/16 1:02 AM, Rahul Singh wrote:
> Thanks for your guidelines, we have big hope from Apache Tomcat
> Team to solve this problem as this is show stopper for our
> application, we have also raise this question on various forum like
> stack overflow and other, but no relevant reply till now.

Why didn't you come to the Tomcat community first?

> Hope you understand my situation,
> 
> please refer the below stackoverflow reference for more detail
> about this issue.
> 
> http://stackoverflow.com/questions/34783438/dofilter-fails-to-get-any-
request-for-the-file-upload-2gb?noredirect=1#comment57315528_34783438
>
>
> 
for more information:
> 
> -No error are printed in tomcat logs. - how to configure "call 
> HttpServletRequest.getHeader("Content-Length") as a String and
> parse it yourself."

I don't have a test-case in front of my, but I'm fairly confident that
Tomcat allows file uploads of greater than 2GiB. I suspect the problem
is another component.

Are you using Servlet 3.0-based file upload, or are you allowing
Struts to handle the file-upload for you? If you use Servlet-3.0
file-upload, then you'll have code that deals with Multipart classes
and configuration in web.xml. If you are using Struts's file-upload,
then you'll mostly just be calling getFile or getInputStream or
however Struts 2 does things (I can't remember how it all works off
the top of my head).

The point is, if you are using Struts, then Tomcat will not touch the
request and Struts is handling the whole thing. If Struts is the
problem, you'll need to talk to the Struts team[1].

If you are using Servlet-3.0 file-upload, then Struts is just a red
herring and this is the right place to get your issue solved.

So far, you have posted some configuration for Struts and some JSP
tablib-filled code, plus some Java code for a Filter. You didn't say
where the Filter was in the filter chain (before or after Struts
filter).  You also mentioned that the form is actually posted using
XMLHttpRequest and not through a standard form, but you didn't explain
what component is doing that or how it actually works.

There isn't enough information here to make any sense of the
situation. Can you please address all of the questions I've posed
above and maybe we can then help you?

Are you sure the request is even made to the server in these cases?
What if the Javascript upload component is failing before it even starts
?

- -chris

[1] http://struts.apache.org/mail.html

>  From: Christopher Schultz 
> <ch...@christopherschultz.net> Sent: Thursday, January 14, 2016
> 8:43 PM To: Tomcat Users List Subject: Re: File size >= 2GB not
> uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK
> 1.7.79]
> 
> André,
> 
> On 1/14/16 5:02 AM, André Warnier (tomcat) wrote:
>> I have not followed this thread in details, but did you check
>> this :
>> 
>> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Common_Attri
butes
>>
>>
>> 
- --> maxPostSize
> 
> +1
> 
>> The maximum size in bytes of the POST which will be handled by
>> the container FORM URL parameter parsing. The limit can be
>> disabled by setting this attribute to a value less than zero. If
>> not specified, this attribute is set to 2097152 (2 megabytes).
>> Note that the FailedRequestFilter can be used to reject requests
>> that exceed this limit.
>> 
>> Note: the size above might relate to the *encoded* size of the 
>> file, as it is transmitted over the WWW (possibly encoded as
>> Base64 e.g.), which may mean that an original 1 MB file
>> translates to more than 1 MB bytes while being uploaded.
>> 
>> Note also : maybe "Struts" is setting this to some other default 
>> value..
>> 
>> Another question : did you check the Tomcat logs ?
> 
> IIRC, Tomcat doesn't log anything in these cases. You have to use 
> the FailedRequestFilter to detect and report the condition. I 
> wouldn't use that Filter in productio, but it would be good as a 
> simple test to see if this is the error that is occurring.
> 
> When Tomcat refuses to allow a file upload that it too large, it 
> simply does not parse the parameters, but the request continues to 
> process as usual (but the servlet doesn't end up getting any of
> the parameters). I'm surprised that Struts isn't getting the
> request in these cases.
> 
> -chris
> 
> -
>
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> ---

Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-14 Thread Rahul Singh
Hello Christopher ,
Thanks for your input,



>ServletRequest.getContentLength is declared to return an int value (32-bit):

>* Integer.MAX_VALUE  = 2^31 - 1 = 2147483647
>* 2GiB = 2 * 1024 * 1024 * 1024 = 2147483648
>* 2147483648 > 2147483647

>Therefore, request.getContentLength cannot be used to fetch
>content-lengths over 2GiB - 1byte.

Yes above is already investigated, BTW thanks .

 You have to use
>ServletRequest.getContentLengthLong (new in servlet 3.1)

for this we have to upgrade tomcat 8, currently we are using tomcat 7.0.54.

> or call
>HttpServletRequest.getHeader("Content-Length") as a String and parse it
>yourself.

OK, but where we need to do this, in init() method or in doFilter() method, but 
FYI, the request(upload file >2GB) is not reached to doFilter().


Apart from above thread we want to share more information so that tomcat team 
help us to get out from this issue.

For my struts project the doFilter() fails to get any request from the file 
upload form in cases the size of the file is greater than 2gb. 
Below is the code fragment:

Filter is as follows:

public void doFilter(ServletRequest req, ServletResponse res, FilterChain 
chain) throws IOException, ServletException
{   
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
HttpSession session = request.getSession(false);
request.setCharacterEncoding("UTF-8");

/*
do the other business work example request response monitoring and 
logging
*/

 chain.doFilter(request, response);  

}

jsp is :



For my jsp the form is submitted as a XMLHttpRequest via the underlying 
javascipt. 
Now when I upload a a file (lesser than 2gb) ,in my dofilter() method I have 
checked the uri and request length for the request.
They are as expected via the action called in the jsp form and the file size.
The file upload works fine in this case. But in case where the file size is 
greater than 2gb ,
in my doFilter() method no request is available for the file upload action 
called by the form submit(for file size greater than 2 gb). 
Thus the upload does not proceed further in such cases.

I am using servlet 3.0. 
What do I need to do to support larger than 2 gb file uploads, so that the 
request reaches the doFilter() method?




From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Wednesday, January 13, 2016 8:11 PM
To: Tomcat Users List
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

Rahul,

On 1/12/16 10:56 PM, Rahul Singh wrote:
> Hi,
>
>> Define "Not successful"?  Exceptions thrown?  File truncated?  Upload
>> never starts?  Never finishes?
>
> Not successful :
>
> Request Never finishes, we have trace the HttpServlet request object
> and request.getContentLength return 0 in case when file size is >=2GB,
>
> No exception thrown, as well as when file size is less than 2GB, then
> request.getContentLength return the correct value of file size in
> byte.

ServletRequest.getContentLength is declared to return an int value (32-bit):

* Integer.MAX_VALUE  = 2^31 - 1 = 2147483647
* 2GiB = 2 * 1024 * 1024 * 1024 = 2147483648
* 2147483648 > 2147483647

Therefore, request.getContentLength cannot be used to fetch
content-lengths over 2GiB - 1byte. You have to use
ServletRequest.getContentLengthLong (new in servlet 3.1) or call
HttpServletRequest.getHeader("Content-Length") as a String and parse it
yourself.

-chris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-14 Thread tomcat

Hi.

I have not followed this thread in details, but did you check this :

http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Common_Attributes
--> maxPostSize  

The maximum size in bytes of the POST which will be handled by the container FORM URL 
parameter parsing. The limit can be disabled by setting this attribute to a value less 
than zero. If not specified, this attribute is set to 2097152 (2 megabytes). Note that the 
FailedRequestFilter can be used to reject requests that exceed this limit.


Note: the size above might relate to the *encoded* size of the file, as it is transmitted 
over the WWW (possibly encoded as Base64 e.g.), which may mean that an original 1 MB file 
translates to more than 1 MB bytes while being uploaded.


Note also : maybe "Struts" is setting this to some other default value..

Another question : did you check the Tomcat logs ?


On 14.01.2016 10:52, Rahul Singh wrote:

Hello Christopher ,
Thanks for your input,




ServletRequest.getContentLength is declared to return an int value (32-bit):



* Integer.MAX_VALUE  = 2^31 - 1 = 2147483647
* 2GiB = 2 * 1024 * 1024 * 1024 = 2147483648
* 2147483648 > 2147483647



Therefore, request.getContentLength cannot be used to fetch
content-lengths over 2GiB - 1byte.


Yes above is already investigated, BTW thanks .

  You have to use

ServletRequest.getContentLengthLong (new in servlet 3.1)


for this we have to upgrade tomcat 8, currently we are using tomcat 7.0.54.


or call
HttpServletRequest.getHeader("Content-Length") as a String and parse it
yourself.


OK, but where we need to do this, in init() method or in doFilter() method, but 
FYI, the request(upload file >2GB) is not reached to doFilter().


Apart from above thread we want to share more information so that tomcat team 
help us to get out from this issue.

For my struts project the doFilter() fails to get any request from the file 
upload form in cases the size of the file is greater than 2gb.
Below is the code fragment:

Filter is as follows:

public void doFilter(ServletRequest req, ServletResponse res, FilterChain 
chain) throws IOException, ServletException
{
 HttpServletRequest request = (HttpServletRequest) req;
 HttpServletResponse response = (HttpServletResponse) res;
HttpSession session = request.getSession(false);
 request.setCharacterEncoding("UTF-8");

/*
do the other business work example request response monitoring and 
logging
*/

 chain.doFilter(request, response);

}

jsp is :



For my jsp the form is submitted as a XMLHttpRequest via the underlying 
javascipt.
Now when I upload a a file (lesser than 2gb) ,in my dofilter() method I have 
checked the uri and request length for the request.
They are as expected via the action called in the jsp form and the file size.
The file upload works fine in this case. But in case where the file size is 
greater than 2gb ,
in my doFilter() method no request is available for the file upload action 
called by the form submit(for file size greater than 2 gb).
Thus the upload does not proceed further in such cases.

I am using servlet 3.0.
What do I need to do to support larger than 2 gb file uploads, so that the 
request reaches the doFilter() method?




From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Wednesday, January 13, 2016 8:11 PM
To: Tomcat Users List
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

Rahul,

On 1/12/16 10:56 PM, Rahul Singh wrote:

Hi,


Define "Not successful"?  Exceptions thrown?  File truncated?  Upload
never starts?  Never finishes?


Not successful :

Request Never finishes, we have trace the HttpServlet request object
and request.getContentLength return 0 in case when file size is >=2GB,

No exception thrown, as well as when file size is less than 2GB, then
request.getContentLength return the correct value of file size in
byte.


ServletRequest.getContentLength is declared to return an int value (32-bit):

* Integer.MAX_VALUE  = 2^31 - 1 = 2147483647
* 2GiB = 2 * 1024 * 1024 * 1024 = 2147483648
* 2147483648 > 2147483647

Therefore, request.getContentLength cannot be used to fetch
content-lengths over 2GiB - 1byte. You have to use
ServletRequest.getContentLengthLong (new in servlet 3.1) or call
HttpServletRequest.getHeader("Content-Length") as a String and parse it
yourself.

-chris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




---

Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-14 Thread Rahul Singh
Dear Christopher,

Thanks for your guidelines, we have big hope from Apache Tomcat Team to solve 
this problem as this is show stopper for our application, we have also raise 
this question on various forum like stack overflow and other,but no relevant 
reply till now.

Hope you understand my situation,

please refer the below stackoverflow reference for more detail about this 
issue. 

http://stackoverflow.com/questions/34783438/dofilter-fails-to-get-any-request-for-the-file-upload-2gb?noredirect=1#comment57315528_34783438


for more information:

 -No error are printed in tomcat logs.
- how to configure "call HttpServletRequest.getHeader("Content-Length") as a 
String and parse it yourself."







From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Thursday, January 14, 2016 8:43 PM
To: Tomcat Users List
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

André,

On 1/14/16 5:02 AM, André Warnier (tomcat) wrote:
> I have not followed this thread in details, but did you check this :
>
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Common_Attributes
> --> maxPostSize

+1

> The maximum size in bytes of the POST which will be handled by the
> container FORM URL parameter parsing. The limit can be disabled by
> setting this attribute to a value less than zero. If not specified, this
> attribute is set to 2097152 (2 megabytes). Note that the
> FailedRequestFilter can be used to reject requests that exceed this limit.
>
> Note: the size above might relate to the *encoded* size of the file, as
> it is transmitted over the WWW (possibly encoded as Base64 e.g.), which
> may mean that an original 1 MB file translates to more than 1 MB bytes
> while being uploaded.
>
> Note also : maybe "Struts" is setting this to some other default value..
>
> Another question : did you check the Tomcat logs ?

IIRC, Tomcat doesn't log anything in these cases. You have to use the
FailedRequestFilter to detect and report the condition. I wouldn't use
that Filter in productio, but it would be good as a simple test to see
if this is the error that is occurring.

When Tomcat refuses to allow a file upload that it too large, it simply
does not parse the parameters, but the request continues to process as
usual (but the servlet doesn't end up getting any of the parameters).
I'm surprised that Struts isn't getting the request in these cases.

-chris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-14 Thread Christopher Schultz
André,

On 1/14/16 5:02 AM, André Warnier (tomcat) wrote:
> I have not followed this thread in details, but did you check this :
> 
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Common_Attributes
> --> maxPostSize   

+1

> The maximum size in bytes of the POST which will be handled by the
> container FORM URL parameter parsing. The limit can be disabled by
> setting this attribute to a value less than zero. If not specified, this
> attribute is set to 2097152 (2 megabytes). Note that the
> FailedRequestFilter can be used to reject requests that exceed this limit.
> 
> Note: the size above might relate to the *encoded* size of the file, as
> it is transmitted over the WWW (possibly encoded as Base64 e.g.), which
> may mean that an original 1 MB file translates to more than 1 MB bytes
> while being uploaded.
> 
> Note also : maybe "Struts" is setting this to some other default value..
> 
> Another question : did you check the Tomcat logs ?

IIRC, Tomcat doesn't log anything in these cases. You have to use the
FailedRequestFilter to detect and report the condition. I wouldn't use
that Filter in productio, but it would be good as a simple test to see
if this is the error that is occurring.

When Tomcat refuses to allow a file upload that it too large, it simply
does not parse the parameters, but the request continues to process as
usual (but the servlet doesn't end up getting any of the parameters).
I'm surprised that Struts isn't getting the request in these cases.

-chris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-13 Thread Rahul Singh
Hi André Warnier,

its 64 bit (OS and JVM)


From: André Warnier (tomcat) <a...@ice-sa.com>
Sent: Wednesday, January 13, 2016 2:17 PM
To: users@tomcat.apache.org
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

maybe a stupid question nowadays, but : is the platform on which you are 
running this
32-bit, or 64-bit ? (OS and JVM)

On 13.01.2016 04:56, Rahul Singh wrote:
> Hi,
>
>> Define "Not successful"?  Exceptions thrown?  File truncated?  Upload
>> never starts?  Never finishes?
>
> Not successful :
>
> Request Never finishes, we have trace the HttpServlet request object and 
> request.getContentLength return 0 in case when file size is >=2GB,
>
> No exception thrown, as well as when file size is less than 2GB, then 
> request.getContentLength return the correct value of file size in byte.
>
>
> Regards,
> Rahul Kumar Singh
> 
> From: David kerber <dcker...@verizon.net>
> Sent: Tuesday, January 12, 2016 6:07 PM
> To: Tomcat Users List
> Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
> Struts: 2.3.24 JAVA: openJDK 1.7.79]
>
> On 1/12/2016 12:01 AM, Rahul Singh wrote:
>>
>> Hello Apache Tomcat team,
>>
>> Sending again with some corrections,
>>
>> File upload in my  application(Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 
>> 1.7.79) is not successful for greater than 2 gb. After previous discussion 
>> here on previous thread, I migrated my application to struts 2.3.24 as the 
>> only possible solution in form of jakarta-stream parser for large size 
>> uploads (greater than 2gb).
>> But after successfully migrating to struts 2.3.24 from 2.1.8, file upload 
>> greater than 2 gb still not supported. I want to use jakarta-streams for 
>> this purpose.Following is the code
>> snippet:
>>
>>
>> In struts.xml:
>> 
>>
>> 
>> 
>>
>> In JSP:
>> ===
>>
>> > namespace="xyz"   validateFields="false" method="post"
>> enctype="multipart/form-data">
>>
>>
>> Alongwith with configuring server.xml with maxPostSize element and 
>> mutipart-config in web.xml But still the file upload request for greater 
>> than 2 gb not successful.
>
> Define "Not successful"?  Exceptions thrown?  File truncated?  Upload
> never starts?  Never finishes?
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-13 Thread tomcat
maybe a stupid question nowadays, but : is the platform on which you are running this 
32-bit, or 64-bit ? (OS and JVM)


On 13.01.2016 04:56, Rahul Singh wrote:

Hi,


Define "Not successful"?  Exceptions thrown?  File truncated?  Upload
never starts?  Never finishes?


Not successful :

Request Never finishes, we have trace the HttpServlet request object and 
request.getContentLength return 0 in case when file size is >=2GB,

No exception thrown, as well as when file size is less than 2GB, then 
request.getContentLength return the correct value of file size in byte.


Regards,
Rahul Kumar Singh

From: David kerber <dcker...@verizon.net>
Sent: Tuesday, January 12, 2016 6:07 PM
To: Tomcat Users List
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

On 1/12/2016 12:01 AM, Rahul Singh wrote:


Hello Apache Tomcat team,

Sending again with some corrections,

File upload in my  application(Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 
1.7.79) is not successful for greater than 2 gb. After previous discussion here 
on previous thread, I migrated my application to struts 2.3.24 as the only 
possible solution in form of jakarta-stream parser for large size uploads 
(greater than 2gb).
But after successfully migrating to struts 2.3.24 from 2.1.8, file upload 
greater than 2 gb still not supported. I want to use jakarta-streams for this 
purpose.Following is the code
snippet:


In struts.xml:





In JSP:
===




Alongwith with configuring server.xml with maxPostSize element and mutipart-config 
in web.xml But still the file upload request for greater than 2 gb not 
successful.


Define "Not successful"?  Exceptions thrown?  File truncated?  Upload
never starts?  Never finishes?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-13 Thread Christopher Schultz
Rahul,

On 1/12/16 10:56 PM, Rahul Singh wrote:
> Hi,
> 
>> Define "Not successful"?  Exceptions thrown?  File truncated?  Upload
>> never starts?  Never finishes?
> 
> Not successful :
> 
> Request Never finishes, we have trace the HttpServlet request object
> and request.getContentLength return 0 in case when file size is >=2GB,
> 
> No exception thrown, as well as when file size is less than 2GB, then
> request.getContentLength return the correct value of file size in
> byte.

ServletRequest.getContentLength is declared to return an int value (32-bit):

* Integer.MAX_VALUE  = 2^31 - 1 = 2147483647
* 2GiB = 2 * 1024 * 1024 * 1024 = 2147483648
* 2147483648 > 2147483647

Therefore, request.getContentLength cannot be used to fetch
content-lengths over 2GiB - 1byte. You have to use
ServletRequest.getContentLengthLong (new in servlet 3.1) or call
HttpServletRequest.getHeader("Content-Length") as a String and parse it
yourself.

-chris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-12 Thread Rahul Singh
Hi,

>Define "Not successful"?  Exceptions thrown?  File truncated?  Upload
>never starts?  Never finishes?

Not successful :

Request Never finishes, we have trace the HttpServlet request object and 
request.getContentLength return 0 in case when file size is >=2GB,

No exception thrown, as well as when file size is less than 2GB, then 
request.getContentLength return the correct value of file size in byte.


Regards,
Rahul Kumar Singh

From: David kerber <dcker...@verizon.net>
Sent: Tuesday, January 12, 2016 6:07 PM
To: Tomcat Users List
Subject: Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 
Struts: 2.3.24 JAVA: openJDK 1.7.79]

On 1/12/2016 12:01 AM, Rahul Singh wrote:
>
> Hello Apache Tomcat team,
>
> Sending again with some corrections,
>
> File upload in my  application(Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 
> 1.7.79) is not successful for greater than 2 gb. After previous discussion 
> here on previous thread, I migrated my application to struts 2.3.24 as the 
> only possible solution in form of jakarta-stream parser for large size 
> uploads (greater than 2gb).
> But after successfully migrating to struts 2.3.24 from 2.1.8, file upload 
> greater than 2 gb still not supported. I want to use jakarta-streams for this 
> purpose.Following is the code
> snippet:
>
>
> In struts.xml:
> 
>
> 
> 
>
> In JSP:
> ===
>
>  namespace="xyz"   validateFields="false" method="post"
> enctype="multipart/form-data">
>
>
> Alongwith with configuring server.xml with maxPostSize element and 
> mutipart-config in web.xml But still the file upload request for greater than 
> 2 gb not successful.

Define "Not successful"?  Exceptions thrown?  File truncated?  Upload
never starts?  Never finishes?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-12 Thread David kerber

On 1/12/2016 12:01 AM, Rahul Singh wrote:


Hello Apache Tomcat team,

Sending again with some corrections,

File upload in my  application(Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 
1.7.79) is not successful for greater than 2 gb. After previous discussion here 
on previous thread, I migrated my application to struts 2.3.24 as the only 
possible solution in form of jakarta-stream parser for large size uploads 
(greater than 2gb).
But after successfully migrating to struts 2.3.24 from 2.1.8, file upload 
greater than 2 gb still not supported. I want to use jakarta-streams for this 
purpose.Following is the code
snippet:


In struts.xml:





In JSP:
===




Alongwith with configuring server.xml with maxPostSize element and mutipart-config 
in web.xml But still the file upload request for greater than 2 gb not 
successful.


Define "Not successful"?  Exceptions thrown?  File truncated?  Upload 
never starts?  Never finishes?



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-11 Thread Rahul Singh
Hello Apache Tomcat team,


File upload in my  application(Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 
1.7.79) is not successful for greater than 2 gb. After previous
discussion here on previous thread, I migrated my application to struts 2.3.24 
as the only
possible solution in form of jakarta-stream parser for large size uploads 
(greater than 2gb).
But after successfully migrating to struts 2.3.24 from 2.1.8, file upload 
greater than 2 gb
still not supported. I want to use jakarta-streams for this purpose.Following 
is the code
snippet:
In struts.xml:constant name="struts.multipart.parser" 
value="jakarta-stream" /constant
name="struts.multipart.maxSize" value="3147483648" /
jsp file:s:form id="uploadData" action="abc_UploadAction" namespace="xyz" 
validateFields="false"
method="post" enctype="multipart/form-data"

Alongwith with configuring server.xml with maxPostSize element and 
mutipart-config in web.xml
But still the file upload request for greater than 2 gb not successful.


Thanks
Rahul



Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-11 Thread Rahul Singh

Hello Apache Tomcat team,

Sending again with some corrections,

File upload in my  application(Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 
1.7.79) is not successful for greater than 2 gb. After previous discussion here 
on previous thread, I migrated my application to struts 2.3.24 as the only 
possible solution in form of jakarta-stream parser for large size uploads 
(greater than 2gb).
But after successfully migrating to struts 2.3.24 from 2.1.8, file upload 
greater than 2 gb still not supported. I want to use jakarta-streams for this 
purpose.Following is the code
snippet:


In struts.xml:





In JSP:
===




Alongwith with configuring server.xml with maxPostSize element and 
mutipart-config in web.xml But still the file upload request for greater than 2 
gb not successful.


Thanks
Rahul


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org