Struts 7.1.1 - File upload
Tamás Barta <[email protected]> Wed, 3 Jun 2026 11:27:20 +0200
| Newsgroups | gmane.comp.jakarta.struts.user |
|---|---|
| Message-ID | <CAM+Uwiy4kkJRYc0rdghZkSuaMdB+WXbT30NKkUxprfxj5Hx=Cg@mail.gmail.com> |
--00000000000078f25c0653560955
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi!
I have a problem with Struts 7.1.1. The exception:
java.lang.NoSuchMethodError: 'void
org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletDiskFileUploa=
d.setSizeMax(long)'
at
deployment.webstore.ear//org.apache.struts2.dispatcher.multipart.AbstractMu=
ltiPartRequest.prepareServletFileUpload(AbstractMultiPartRequest.java:218)
at
deployment.webstore.ear//org.apache.struts2.dispatcher.multipart.JakartaMul=
tiPartRequest.processUpload(JakartaMultiPartRequest.java:114)
at
deployment.webstore.ear//org.apache.struts2.dispatcher.multipart.AbstractMu=
ltiPartRequest.parse(AbstractMultiPartRequest.java:260)
at
deployment.webstore.ear//org.apache.struts2.dispatcher.multipart.MultiPartR=
equestWrapper.<init>(MultiPartRequestWrapper.java:81)
...
The problematic lines in AbstractMultiPartRequest.java:218:
JakartaServletDiskFileUpload servletFileUpload =3D
createJakartaFileUpload(charset, saveDir);
if (maxSize !=3D null) {
LOG.debug("Applies max size: {} to file upload request",
maxSize);
servletFileUpload.*setSizeMax*(maxSize);
}
The maven dependencies of 7.1.1 contains "org.apache.commons =C2=BB
commons-fileupload2-jakarta-servlet6" version "2.0.0-M4" updates "2.0.0-M5"=
.
The M4 version contains "setSizeMax" but the M5 version doesn't. Maven
automatically uses M5 for me, which cause the problem.
It would be better a Struts 7 release with M5 version then stuck to M4 in
pom.xml
Thanks, Tam=C3=A1s Barta
--00000000000078f25c0653560955--