A minha classe está como no codigo da aula
package br.com.alura.gerenciador.web;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns="/busca")
public class BuscaEmpresa extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
PrintWriter writer = resp.getWriter();
writer.println("<html><body>");
writer.println("Resultado da busca: <br>");
writer.println("</body></html>");
}
}
e o console fica assim:
nov 10, 2016 2:15:20 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:gerenciador' did not find a matching property.
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/9.0.0.M11
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Oct 6 2016 18:54:10 UTC
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 9.0.0.0
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 4.4.0-45-generic
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: /usr/lib/jvm/java-8-oracle/jre
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_111-b14
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /home/awesomed/workspaceweb/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /home/awesomed/Documents/Alura/Servlets/apache-tomcat-9.0.0.M11
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/home/awesomed/workspaceweb/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/home/awesomed/Documents/Alura/Servlets/apache-tomcat-9.0.0.M11
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=/home/awesomed/workspaceweb/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/home/awesomed/Documents/Alura/Servlets/apache-tomcat-9.0.0.M11/endorsed
nov 10, 2016 2:15:20 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=UTF-8
nov 10, 2016 2:15:20 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
nov 10, 2016 2:15:21 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
nov 10, 2016 2:15:21 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
nov 10, 2016 2:15:21 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
nov 10, 2016 2:15:21 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
nov 10, 2016 2:15:21 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2474 ms
nov 10, 2016 2:15:21 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
nov 10, 2016 2:15:21 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/9.0.0.M11
nov 10, 2016 2:15:22 AM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
nov 10, 2016 2:15:22 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [http-nio-8080]
nov 10, 2016 2:15:22 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [ajp-nio-8009]
nov 10, 2016 2:15:22 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1155 ms
Estou usando jdk 1.8 e Tomcat 9.0 O resultado na pagina web é:
HTTP Status 404 - /gerenciador/busca
type Status report
message /gerenciador/busca
description The requested resource is not available.
Apache Tomcat/9.0.0.M11