jakarta-eewildflyjava-11wildfly-26jakarta-migration

Wildfly 26 could not deploy a Servlet that extends from Jakarta HttpServlet


I am using Eclipse IDE to create a simple Java web application. I am using Wildfly 26, Java 11. I run the web app inside the Eclipse. I created a TestServlet with @WebServlet("/TestServlet") with default generated implementation (Printing Servled at .... )

If the TestServlet extends from javax.servlet.http.HttpServlet -> The servlet was deployed successfully -> I can access http://localhost:8080/myapp/TestServet to see the servlet output.

BUT if the TestServlet extends from jakarta.servlet.http.HttpServlet -> The servlet was NOT deployed successfully -> http://localhost:8080/myapp/TestServet returns "Not Found". Eclipse Console did not show any error messages relating to the Servlet deployment.

Please help. Thank you!


Solution

  • WildFly 26 is JakartaEE 8 compliant. If you want to use JakartaEE 9 use WildFly 26 preview