Hola! Tengo el siguiente error al momento de abrir mi html en el navegador:
INFO: Error analizando cabecera de requerimiento HTTP Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Se encontr� un car�cter inv�lido en el nombre del m�todo. Los nombres de m�todos HTTP deben ser tokens at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:407) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:263) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:1623)
No entiendo de donde puede venir este error, les adjunto mi codigo. No se si estare pasando algo por alto...
package com.alura.gerenciador.servlet;
import java.io.IOException;
import java.io.PrintWriter;
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(urlPatterns = "/hola")
public class HolaMundoServlet extends HttpServlet{
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException {
// TODO Auto-generated method stub
PrintWriter out = resp.getWriter();
out.println("<html>");
out.println("<body>");
out.println("Hola mundo por tu servlet");
out.println("</body>");
out.println("</html>");
}
}