Estou com o mesmo problema, com esse erro 500, conseguem me ajudar?
Entendo que podemos trocar o Tomcat para o 9 e vai rodar, mas pq não roda na versão 10, ou o que fazer para rodar?
Tomcat: 10.0.5
ListaEmpresasServlet.java:
package br.com.alura.gerenciador.servlet;
import java.io.IOException;
import java.util.List;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@WebServlet("/listaEmpresas")
public class ListaEmpresasServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Banco banco = new Banco();
List<Empresa> lista = banco.getEmpresas();
request.setAttribute("empresas", lista);
RequestDispatcher rd = request.getRequestDispatcher("/listaEmpresas.jsp");
rd.forward(request, response);
}
}
STACK:
HTTP Status 500 – Internal Server Error
Type Exception Report
Message java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
jakarta.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:332)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:770)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
br.com.alura.gerenciador.servlet.ListaEmpresasServlet.doGet(ListaEmpresasServlet.java:28)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:663)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:770)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)