Question about commons-fileupload2-core-2.0.0-M2 working with Java 8

Yan Hua Lan <[email protected]> Tue, 10 Sep 2024 13:31:53 +1000
Newsgroups gmane.comp.jakarta.commons.user
Message-ID <CAHoDcy4m7Fo6sQPQqvkE5kWY2j6Ryvqa-A-sbU0R6B5NnNDvqQ@mail.gmail.com>
Hi,
I have a question about commons-fileupload2-core-2.0.0-M2 working with Java
8.
In our current application, we call commons-fileupload 1.5 working with
Java 8 to upload files.
Recently I tried to migrate to commons-fileupload2-core-2.0.0-M2, however,
it reports the following error:
[WARNING ] CWPMI2005W: The MicroProfile Metrics exception mapper detected
and is handling an unhandled exception from the JAX-RS application.

                                   java.lang.UnsupportedClassVersionError:
JVMCFRE199E bad major version 55.0 of
class=org/apache/commons/fileupload2/javax/JavaxServletFileUpload, the
maximum supported major version is 52.0; offset=6
        at java.lang.ClassLoader.defineClassImpl(Native Method)
        at java.lang.ClassLoader.defineClassInternal(ClassLoader.java:399)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:360)
        at
com.ibm.ws.classloading.internal.AppClassLoader.definePackageAndClass(AppClassLoader.java:435)
        at [internal classes]
        ......
        at sun.reflect.GeneratedMethodAccessor1015.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Method.java:508)
        at
com.ibm.ws.jaxrs20.server.LibertyJaxRsServerFactoryBean.performInvocation(LibertyJaxRsServerFactoryBean.java:649)
        at [internal classes]
        at
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:70)
        at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203)
        at [internal classes]


If I change to Java 21, then it works.

It is strange as the following Apache sites claim that it supports Java 8
https://commons.apache.org/proper/commons-fileupload/download_fileupload.cgi
https://commons.apache.org/proper/commons-fileupload/migration.html

Could you please help to investigate why commons-fileupload2-core-2.0.0-M2
does not support Java 8?
Thanks!

-- 
This e-mail message has been scanned and cleared by Google Message Security 
and the UNICOM Global security systems. This message is for the named 
person's use only. If you receive this message in error, please delete it 
and notify the sender.