On 29/05/2023 10:36, Lauri wrote:
From Tomcat 10 and onwards there has been a move from Java EE to Jakarta EE as
part of the transfer of Java EE to the Eclipse Foundation, the primary package
for all implemented APIs has changed from javax.* to jakarta.*.
Note the above.
<snip />
I have these libraries for the TESTS application:
/u01/tomcat/base/middleware/tomcat10/webapps/TESTS/WEB-INF/lib:
commons-fileupload-1.5-test-sources.jar
commons-fileupload-1.5-tests.jar
commons-fileupload-1.5-sources.jar
commons-fileupload-1.5-javadoc.jar
You should not have any of the above in your web application.
commons-fileupload-1.5.jar
That library uses the Java EE APIs so it won't work with Tomcat 10 as
you have discovered.
Does someone know if this is related to a bug ?
No. There is no bug.
Do I use the correct servlet-api jar package ?
If you are using Tomcat 10, you need to use the Jakarta EE package
names. You can't use the Java EE package names. You can't use any
library that uses the Java EE package names.
Do Tomcat 10 need to be specifically configured for using servlet-api and
jakarta EE packages ?
No.
Does someone know what can be the problem ?
See above. You are trying to use a Java EE library with Jakarta EE.
Thanks by advance for any tip(s) and/or suggestion(s).
Option 1.
Write your web application using the Jakarta EE APIs.
Use the Tomcat migration tool for Jakarta EE to convert
commons-fileupload-1.5.jar from from Java EE to Jakarta EE (and any
other libraries using the Java EE APIs).
Deploy your web application with the converted JARs.
Option 2.
Write your web application using the Java EE APIs and then deploy it to
webapps-javaee rather than webapps and Tomcat will use the migration
tool to convert your web application for you.
Option 3.
Write your web application using the Java EE APIs and convert it to
Jkarata EE using the migration tool. Once converted, deploy it to the
webapps directory.
Note: If you use any deprecated Java EE APIs you may still see failures
after conversion as Jakarta EE 10 most of the deprecated APIs.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org