C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\conf\Catalina\localhost\VirtualStore.xml
You’re thus using Tomcat 10.x which is based off Servlet API version 5.0 which in turn is part of Jakarta EE version 9.
java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener
This is unexpected. The javax.*
package has been renamed to jakarta.*
package since Jakarta EE version 9. This thus means that the deployed web application is actually not compatible with Jakarta EE version 9. The deployed web application is most likely developed for an older JEE version where the javax.*
package is still used.
So, summarized, the targeted JEE versions don’t match up and it’s causing trouble for you. You have 2 options:
-
Downgrade Tomcat to version 9.x. This is the latest available version which still uses the
javax.*
package. -
Or, upgrade the deployed web application to target Jakarta EE 9 instead. I.e. adjust the project’s dependencies (e.g.
pom.xml
) to reference JEE 9+ based versions instead, and perform a project-wide Find & Replace ofjavax.*
tojakarta.*
(of course except forjavax.naming.*
andjavax.xml.*
and probably a few others, but the Java compiler will quickly point out them for you).
See also:
- Apache Tomcat – Versions
- Tomcat 9 casting servlets to javax.servlet.Servlet instead of jakarta.servlet.http.HttpServlet (this answer contains complete examples of proper
pom.xml
declarations for Tomcat 10+, Tomcat 9-, JEE 9+ and JEE 8-).