Livro Spring MVC

Comecei agora a estudar pelo livro Spring MVC e a principio ao final do capitulo 2 o código já deveria funcionar, mas da erro 404 no navegador.
Esta faltando alguma classe para a página pelo menos subir? No console do tomcat não aparece nenhum erro.

Coloquei o código atual no github: https://github.com/ericteles54/cursolivro_spring_mvc

Log do tomcat

Oct 25, 2016 10:30:33 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:br.com.casadocodigo.loja' did not find a matching property.
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/8.0.30
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Dec 1 2015 22:30:46 UTC
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         8.0.30.0
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Linux
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            4.4.0-45-generic
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             /usr/local/java/jdk1.8.0_91/jre
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.8.0_91-b14
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         /media/truecrypt1/Java/Projetos/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         /home/eric/tmp/EstudoJava/Servidores/apache-tomcat-8.0.30
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/media/truecrypt1/Java/Projetos/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/home/eric/tmp/EstudoJava/Servidores/apache-tomcat-8.0.30
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=/media/truecrypt1/Java/Projetos/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/home/eric/tmp/EstudoJava/Servidores/apache-tomcat-8.0.30/endorsed
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=UTF-8
Oct 25, 2016 10:30:33 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
Oct 25, 2016 10:30:33 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Oct 25, 2016 10:30:33 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Oct 25, 2016 10:30:33 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Oct 25, 2016 10:30:33 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Oct 25, 2016 10:30:33 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1255 ms
Oct 25, 2016 10:30:33 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Oct 25, 2016 10:30:33 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.30
Oct 25, 2016 10:30:35 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.
Oct 25, 2016 10:30:35 AM org.apache.catalina.core.ApplicationContext log
INFO: Spring WebApplicationInitializers detected on classpath: [org.br.com.casadocodigo.conf.ServletSpringMVC@24c99996]
log4j:WARN No appenders could be found for logger (org.br.com.casadocodigo.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.
Oct 25, 2016 10:30:36 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'dispatcher'
Oct 25, 2016 10:30:36 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Oct 25, 2016 10:30:36 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Oct 25, 2016 10:30:36 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3000 ms

Att,

Eric

Oi Eric,
Olhei seu código…e na classe ServletSpringMVC.java
o método getServletMappings() deve ter um return new String[] {"/"};

Veja como deve ficar: (Página 19 do livro. versão 20.1.5)
@Override
protected String[] getServletMappings() {
return new String[] {"/"};
}

E em AppWebConfiguration.java

O correto é @ComponentScan(basePackages = "br.com.casadocodigo")
você está utilizando"org.br.com.casadocodigo.controllers" . Veja que não existe diretório org dentro do seu projeto, dessa forma o spring nunca vai achar os controllers.

Você pode deixar o pacote raiz "br.com.casadocodigo" que tudo que estiver abaixo dele o spring varre e então encontra os controllers.

Oi Gracyane,

Muito obrigado!!! Vou tentar as correções e rodar o projeto agora.