3
respostas

Página HTTP 404

Bom dia, estou acompanhando a aula de Spring MVC I e tive um problema que considero estranho, meu código compila e roda certinho sem Erro nem Warnings quando vou entrar em "Localhost:8080/casadocodigo/" na web eu recebo o HTTP 404 NOT FOUND, e no console mostra que realmente entrou no metodo chaamado postarei abaixo o que esta no console

3 respostas

nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server version name: Apache Tomcat/9.0.27 nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server built: Oct 7 2019 09:57:22 UTC nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server version number: 9.0.27.0 nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: OS Name: Windows 10 nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: OS Version: 10.0 nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Architecture: amd64 nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Java Home: C:\Program Files\Java\jre1.8.0_221 nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: JVM Version: 1.8.0_221-b11 nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: JVM Vendor: Oracle Corporation nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: CATALINA_BASE: C:\Users\kpinheiro\eclipse-workspace2.metadata.plugins\org.eclipse.wst.server.core\tmp0 nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: CATALINA_HOME: C:\Users\kpinheiro\Downloads\apache-tomcat-9.0.27- prod\apache-tomcat-9.0.27 nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dcatalina.base=C:\Users\kpinheiro\eclipse-workspace2.metadata.plugins\org.eclipse.wst.server.core\tmp0 nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dcatalina.home=C:\Users\kpinheiro\Downloads\apache-tomcat-9.0.27- prod\apache-tomcat-9.0.27 nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dwtp.deploy=C:\Users\kpinheiro\eclipse-workspace2.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Djava.endorsed.dirs=C:\Users\kpinheiro\Downloads\apache-tomcat-9.0.27- prod\apache-tomcat-9.0.27\endorsed nov 06, 2019 11:13:40 AM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dfile.encoding=Cp1252 nov 06, 2019 11:13:40 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFORMAÇÕES: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_221\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_221/bin/server;C:/Program Files/Java/jre1.8.0_221/bin;C:/Program Files/Java/jre1.8.0_221/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\TortoiseGit\bin;C:\Users\kpinheiro\Downloads\gradle-5.5.1-all\gradle-5.5.1\bin;C:\Users\kpinheiro\Downloads\apache-maven-3.6.1-bin\apache-maven-3.6.1\bin;C:\Program Files\Java\jdk1.8.0_221\bin;C:\Program Files\Java\jdk1.8.0_221\bin;C:\Users\kpinheiro\Downloads\apache-maven\apache-maven-3.6.2\bin;C:\Users\kpinheiro\OneDrive - UNIVERSO ONLINE S.A\Área de Trabalho\Git\Git\cmd;C:\Program Files\MySQL\MySQL Shell 8.0\bin;C:\Users\kpinheiro\OneDrive - UNIVERSO ONLINE S.A\Área de Trabalho;;.] nov 06, 2019 11:13:40 AM org.apache.coyote.AbstractProtocol init INFORMAÇÕES: Initializing ProtocolHandler ["http-nio-8080"] nov 06, 2019 11:13:40 AM org.apache.coyote.AbstractProtocol init INFORMAÇÕES: Initializing ProtocolHandler ["ajp-nio-8009"] nov 06, 2019 11:13:40 AM org.apache.catalina.startup.Catalina load INFORMAÇÕES: Server initialization in [693] milliseconds nov 06, 2019 11:13:40 AM org.apache.catalina.core.StandardService startInternal INFORMAÇÕES: Starting service [Catalina] nov 06, 2019 11:13:40 AM org.apache.catalina.core.StandardEngine startInternal INFORMAÇÕES: Starting Servlet engine: [Apache Tomcat/9.0.27] nov 06, 2019 11:13:46 AM org.apache.jasper.servlet.TldScanner scanJars INFORMAÇÕES: 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 06, 2019 11:13:56 AM org.apache.catalina.core.ApplicationContext log INFORMAÇÕES: 1 Spring WebApplicationInitializers detected on classpath ( aqui não aceita tanto código o restante coloco aqui)

log4j:WARN No appenders could be found for logger (br.com.casadocodigo.loja.conf.ServletSpringMVC). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. nov 06, 2019 11:13:56 AM org.apache.jasper.servlet.TldScanner scanJars INFORMAÇÕES: 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 06, 2019 11:13:56 AM org.apache.catalina.core.ApplicationContext log INFORMAÇÕES: Initializing Spring DispatcherServlet 'dispatcher' Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary. nov 06, 2019 11:14:04 AM org.apache.coyote.AbstractProtocol start INFORMAÇÕES: Starting ProtocolHandler ["http-nio-8080"] nov 06, 2019 11:14:04 AM org.apache.coyote.AbstractProtocol start INFORMAÇÕES: Starting ProtocolHandler ["ajp-nio-8009"] nov 06, 2019 11:14:04 AM org.apache.catalina.startup.Catalina start INFORMAÇÕES: Server startup in [23.730] milliseconds Entrando na Home da CDC

( Em todos os metodos que eu chamo ele entra mas não me mostra nada, até quando entro para o cadastro de um novo produto ele entra mas sem resultado visivel, no momento que eu entro no banco de dados, ele deixa o produto cadastrado mas de forma padrão, "Null" e páginas = 0)

Dando uma olhada na sua Exception, essa parte me chamou atenção: 
Initializing Spring DispatcherServlet 'dispatcher' Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver'.

Na classe JPAConfiguration coloca isso pra ver se resolve:
DriverManagerDataSource dmds = new DriverManagerDataSource();
dmds.setDriverClassName("com.mysql.cj.jdbc.Driver"); 

Mas posta seus códigos aqui pra garantir.