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 
> *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
>  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 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
- -
>
>> 

>  doFilter() fails to get any request for the file upload > 2gb 
> 

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 >
> > *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
> > > 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 

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 
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 
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]

doFilter() fails to get any request for the file upload > 
2gb
stackoverflow.com
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 

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 
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? 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