Hi,

It seems this happens also with tomcat 10.1.x under certain circumstances.
I have create

https://github.com/reiern70/file-upload-broken

to illustrate the problem. Hope this helps reproduce the problem. If I can
further assist getting this "fixed" please let me know

On Fri, May 2, 2025 at 2:50 PM Ernesto Reinaldo Barreiro <reier...@gmail.com>
wrote:

> Hi,
>
> Mamy thanks for your email.
>
> On Fri, May 2, 2025 at 1:42 PM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
>> Ernesto,
>>
>> On 5/1/25 8:51 PM, Ernesto Reinaldo Barreiro wrote:
>> > We have an Apache Wicket application that I just ported to wicket 10.
>> The
>> > application works as expected with the latest Tomcat 10.1.40. But our
>> > application does not work with Tomcat 11.0.6 because file upload
>> (multipart
>> > processing is broken).
>> >
>> > Apache wicket 10.x uses fileupload2.jakarta.servlet5 thus I create a
>> branch
>> > using fileupload2.jakarta.servlet6 (
>> >
>> https://mvnrepository.com/artifact/org.apache.commons/commons-fileupload2-jakarta-servlet6/2.0.0-M2
>> )
>> > thinking that might be the problem... But after some debugging the
>> problem
>> > seems to be in Http11InputBuffer and related classes (it seems the whole
>> > package is very different from 10.x branch) or the way fileupload2 is
>> using
>> > them.
>> >
>> > Has anyone experienced any similar problems?
>>
>> Are you able to package a simple test-case for this?
>>
>
> I would try to create something using Wicket. Or maybe fileupload2... But
> I do not know tomcat codebase
>
>
>>
>> Does Wicket handle its own multipart logic, or is it relying on Tomcat
>> to provide that facility?
>>
>
> Wicket handles the multipart logic via
>
>
> https://mvnrepository.com/artifact/org.apache.commons/commons-fileupload2-jakarta-servlet6/2.0.0-M2
>
> Wicket includes some machinery to "push" upload progress notifications to
> the client side (this is done via some special counting stream wrapped
> around the original stream).
>
> See
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/MultipartServletWebRequestImpl.java#L163
>
> By the way, it would be nice to have something like that baked into tomcat
> too.
>
> The problem is when this machinery in Wicket is used then tomcat has
> already "exhausted" the request.  I.e. Method
>
>
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/MultipartServletWebRequestImpl.java#L178
>
> finds no files and no parameters as the underlying Http11InputBuffer was
> already consumed by tomcat. Wicket can always recover those via
> request.getParts() but then upload progress will not work
> Thus, it is not clear to me this is a tomcat problem, just that Wicket
> needs to plug in this "machinery" (MultipartServletWebRequestImpl) early
> on... I'm trying to do so in Wicket code.
>
>
>> Tomcat 10 and 11 are very similar to each other, though they support
>> different versions of the relevant Jakarta EE APIs. Is Wicket 10
>> documented to work with Jakarta EE 11? Is Wicket 10 documented to work
>> with Jakarta EE 10?
>>
>
> I'm not certain what the documentation says... I'm just porting our
> application and I have found out these problems in Wicket and I'm trying to
> fix them.
> Regarding tomat I have compared the code and I see a few changes in tomcat
> 11.x regarding the http1 package that are not part of 10.1.x. Wicket works
> ok with 10.1.x
>
> -chris
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>


-- 
Regards - Ernesto Reinaldo Barreiro

Reply via email to