Capítulo 2 - Mensagem Rejected bean name 'homeController': no URL paths identified

237 views
Skip to first unread message

Rodrigo Magalhães

unread,
Apr 12, 2016, 5:50:56 PM4/12/16
to livro-springmvc
Olá pessoal,

Estou começando o livro e já no capítulo 2, logo pelo início eu não consigo prosseguir. 

Segundo o item 2.3 - Habilitando o Spring MVC, após fazer as mudanças e inclusões do livro, eu deveria ter um erro HTTP Status 500... De qualquer forma, o erro que eu tenho é apenas um erro 404 de Resource Not Available, me dando a impressão de que a aplicação simplesmente não está lá (o @RequestMapping está de acordo com o endereço chamado no browser).

Quando eu vejo o log de iniciação do tomcat eu descubro uma série de erros de -Rejected bean name-, entre eles, o do controller para a url do exemplo. A linha é como abaixo:

17:54:08 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'homeController': no URL paths identified

Existem muitas outras linhas como essa, mas para ooutros beans internos ao Spring MVC, como estas aqui:

17:54:08 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor': no URL paths identified
17:54:08 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'homeController': no URL paths identified
17:54:08 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration': no URL paths identified
17:54:08 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'handlerExceptionResolver': no URL paths identified

Alguém poderia me dizer o que estou fazendo de errado? já conferi até com o código do github e parece (de repente eu pulei algo) que está tudo em ordem.

Obrigado,

Rodrigo

Alberto SOUZA

unread,
Apr 12, 2016, 6:41:58 PM4/12/16
to Rodrigo Magalhães, livro-springmvc
Oi Rodrigo, tem como postar o link para o código, por exemplo no github?

--
Você recebeu essa mensagem porque está inscrito no grupo "livro-springmvc" dos Grupos do Google.
Para cancelar inscrição nesse grupo e parar de receber e-mails dele, envie um e-mail para livro-springm...@googlegroups.com.
Para ver essa discussão na Web, acesse https://groups.google.com/d/msgid/livro-springmvc/97a3a399-59ec-40bf-95c7-f7bf26d718ff%40googlegroups.com.
Para mais opções, acesse https://groups.google.com/d/optout.

Rodrigo Magalhães

unread,
Apr 12, 2016, 7:08:57 PM4/12/16
to livro-springmvc, rodrigo.r...@gmail.com
Olá Alberto, 

Obrigado pela velocidade!

Eu peguei o commit id: 51f3ce0c3184968b8b8d527542ac211373f6060c do github.

No meu setup aqui eu estou usando Oracle Java, 1.8, Tomcat V8.0 e STS:

Spring Tool Suite 

Version: 3.7.3.RELEASE
Build Id: 201602250940
Platform: Eclipse Mars.2 (4.5.2)

Abraços,

Rodrigo

Alberto SOUZA

unread,
Apr 12, 2016, 7:27:55 PM4/12/16
to Rodrigo Magalhães, livro-springmvc
Oi Rodrigo,

Vc alterou o nome da jsp, para hello-world.jsp? Caso esteja exatamente com a mesma versão do projeto, pode comitar ele no seu github e mandar o link? Caso prefira, pode mandar um zip por aqui também.

Rodrigo Magalhães

unread,
Apr 13, 2016, 8:14:00 AM4/13/16
to livro-springmvc, rodrigo.r...@gmail.com
Olá Alberto

Acabo de subir para o meu github: https://github.com/rodrigorrm/casadosimba com o commit id: 480f28cd08acd03f62ca65bf7a6d66a03cd12553.

Tanto o código que eu venho construindo com o auxílio do livro quanto o o que eu baixei do git do livro geram o mesmo tipo de situação e, sim, o hello-world.jsp está lá na pasta WEB-INF/views com o HomeController.index retornando hello-world.

De qualquer forma, eu não tive as mensagens de erro do browser como descritos nos itens 2.3 2 2.4 do livro também. Simplesmente tenho o erro 404.

Obrigado,

Rodrigo

Rodrigo Magalhães

unread,
Apr 13, 2016, 8:24:43 AM4/13/16
to livro-springmvc, rodrigo.r...@gmail.com
Oi, eu não sei se ajuda em algo, mas vai aqui o log completo da inicialização do tomcat:

Novamente, obrigado.

==========================================================================================================================================
abr 13, 2016 9:18:28 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
ADVERTÊNCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:casadosimba' did not find a matching property.
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server version:        Apache Tomcat/8.0.33
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server built:          Mar 18 2016 20:31:49 UTC
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server number:         8.0.33.0
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Name:               Linux
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Version:            3.13.0-68-generic
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Architecture:          amd64
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Java Home:             /usr/lib/jvm/java-8-oracle/jre
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Version:           1.8.0_77-b03
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Vendor:            Oracle Corporation
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_BASE:         /contajusta/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_HOME:         /home/javad/apache-tomcat-8.0.33
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.base=/contajusta/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.home=/home/javad/apache-tomcat-8.0.33
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dwtp.deploy=/contajusta/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Djava.endorsed.dirs=/home/javad/apache-tomcat-8.0.33/endorsed
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dfile.encoding=UTF-8
abr 13, 2016 9:18:28 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: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
abr 13, 2016 9:18:28 AM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["http-nio-8080"]
abr 13, 2016 9:18:28 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMAÇÕES: Using a shared selector for servlet write/read
abr 13, 2016 9:18:28 AM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["ajp-nio-8009"]
abr 13, 2016 9:18:28 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMAÇÕES: Using a shared selector for servlet write/read
abr 13, 2016 9:18:28 AM org.apache.catalina.startup.Catalina load
INFORMAÇÕES: Initialization processed in 1691 ms
abr 13, 2016 9:18:28 AM org.apache.catalina.core.StandardService startInternal
INFORMAÇÕES: Starting service Catalina
abr 13, 2016 9:18:28 AM org.apache.catalina.core.StandardEngine startInternal
INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/8.0.33
abr 13, 2016 9:18:30 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.
abr 13, 2016 9:18:30 AM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: Spring WebApplicationInitializers detected on classpath: [org.casadosimba.loja.conf.ServletSpringMVC@38dedd]
09:18:30 [localhost-startStop-1] DispatcherServlet - Initializing servlet 'dispatcher'
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Adding [servletConfigInitParams] PropertySource with lowest search precedence
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Adding [servletContextInitParams] PropertySource with lowest search precedence
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Adding [jndiProperties] PropertySource with lowest search precedence
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Initialized StandardServletEnvironment with PropertySources [servletConfigInitParams,servletContextInitParams,jndiProperties,systemProperties,systemEnvironment]
abr 13, 2016 9:18:30 AM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: Initializing Spring FrameworkServlet 'dispatcher'
09:18:30 [localhost-startStop-1] DispatcherServlet - FrameworkServlet 'dispatcher': initialization started
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Adding [servletConfigInitParams] PropertySource with lowest search precedence
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Adding [servletContextInitParams] PropertySource with lowest search precedence
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Adding [jndiProperties] PropertySource with lowest search precedence
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Initialized StandardServletEnvironment with PropertySources [servletConfigInitParams,servletContextInitParams,jndiProperties,systemProperties,systemEnvironment]
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Replacing [servletContextInitParams] PropertySource with [servletContextInitParams]
09:18:30 [localhost-startStop-1] StandardServletEnvironment - Replacing [servletConfigInitParams] PropertySource with [servletConfigInitParams]
09:18:30 [localhost-startStop-1] AnnotationConfigWebApplicationContext - Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Wed Apr 13 09:18:30 BRT 2016]; root of context hierarchy
09:18:30 [localhost-startStop-1] AnnotationConfigWebApplicationContext - Registering annotated classes: [class org.casadosimba.loja.conf.AppWebConfiguration]
09:18:30 [localhost-startStop-1] AnnotationConfigWebApplicationContext - Bean factory for WebApplicationContext for namespace 'dispatcher-servlet': org.springframework.beans.factory.support.DefaultListableBeanFactory@2010a080: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,appWebConfiguration]; root of factory hierarchy
09:18:31 [localhost-startStop-1] AnnotationConfigWebApplicationContext - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@40ad1f4a]
09:18:31 [localhost-startStop-1] AnnotationConfigWebApplicationContext - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@44090994]
09:18:31 [localhost-startStop-1] ExceptionHandlerExceptionResolver - Looking for exception mappings: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Wed Apr 13 09:18:30 BRT 2016]; root of context hierarchy
09:18:32 [localhost-startStop-1] RequestMappingHandlerMapping - Looking for request mappings in application context: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Wed Apr 13 09:18:30 BRT 2016]; root of context hierarchy
09:18:32 [localhost-startStop-1] RequestMappingHandlerMapping - Mapped "{[/],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.casadosimba.loja.controllers.HomeController.index()
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Looking for URL mappings in application context: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Wed Apr 13 09:18:30 BRT 2016]; root of context hierarchy
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalRequiredAnnotationProcessor': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalCommonAnnotationProcessor': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'appWebConfiguration': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'homeController': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'handlerExceptionResolver': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'requestMappingHandlerMapping': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'mvcContentNegotiationManager': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'viewControllerHandlerMapping': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'beanNameHandlerMapping': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'resourceHandlerMapping': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'mvcResourceUrlProvider': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'defaultServletHandlerMapping': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'requestMappingHandlerAdapter': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'mvcConversionService': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'mvcValidator': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'mvcPathMatcher': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'mvcUrlPathHelper': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'mvcUriComponentsContributor': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'httpRequestHandlerAdapter': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'simpleControllerHandlerAdapter': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'mvcViewResolver': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'internalResourceViewResolver': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'environment': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'systemProperties': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'systemEnvironment': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'servletContext': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'servletConfig': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'contextParameters': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'contextAttributes': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'messageSource': no URL paths identified
09:18:32 [localhost-startStop-1] BeanNameUrlHandlerMapping - Rejected bean name 'applicationEventMulticaster': no URL paths identified
09:18:32 [localhost-startStop-1] RequestMappingHandlerAdapter - Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Wed Apr 13 09:18:30 BRT 2016]; root of context hierarchy
09:18:32 [localhost-startStop-1] AnnotationConfigWebApplicationContext - Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@fce9068]
09:18:32 [localhost-startStop-1] DispatcherServlet - Unable to locate MultipartResolver with name 'multipartResolver': no multipart request handling provided
09:18:32 [localhost-startStop-1] DispatcherServlet - Unable to locate LocaleResolver with name 'localeResolver': using default [org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver@64caf91c]
09:18:32 [localhost-startStop-1] DispatcherServlet - Unable to locate ThemeResolver with name 'themeResolver': using default [org.springframework.web.servlet.theme.FixedThemeResolver@11ab6bdd]
09:18:32 [localhost-startStop-1] DispatcherServlet - Unable to locate RequestToViewNameTranslator with name 'viewNameTranslator': using default [org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@6c974089]
09:18:32 [localhost-startStop-1] DispatcherServlet - Unable to locate FlashMapManager with name 'flashMapManager': using default [org.springframework.web.servlet.support.SessionFlashMapManager@5aab7b2]
09:18:32 [localhost-startStop-1] ResourceUrlProvider - Looking for resource handler mappings
09:18:32 [localhost-startStop-1] ResourceUrlProvider - No resource handling mappings found
09:18:32 [localhost-startStop-1] DispatcherServlet - Published WebApplicationContext of servlet 'dispatcher' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher]
09:18:32 [localhost-startStop-1] DispatcherServlet - FrameworkServlet 'dispatcher': initialization completed in 2216 ms
09:18:32 [localhost-startStop-1] DispatcherServlet - Servlet 'dispatcher' configured successfully
abr 13, 2016 9:18:32 AM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["http-nio-8080"]
abr 13, 2016 9:18:32 AM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["ajp-nio-8009"]
abr 13, 2016 9:18:32 AM org.apache.catalina.startup.Catalina start
INFORMAÇÕES: Server startup in 4482 ms
==========================================================================================================================================

Alberto SOUZA

unread,
Apr 13, 2016, 10:02:50 AM4/13/16
to Rodrigo Magalhães, livro-springmvc
Oi, vc retornou hello_world, enquanto que o número do arquivo é hello-world.jsp.

Abraço!

Rodrigo Magalhães

unread,
Apr 13, 2016, 1:00:01 PM4/13/16
to livro-springmvc, rodrigo.r...@gmail.com
Oi Alberto,

Mas o correto seria mesmo isso, não? Afinal, na classe internalResourceViewResolver a gente define a pasta e o sufixo dos arquivos, não é?

Já tenho isso definido na classe, então, acredito que está correto não colocar o .jsp no retorno do controller. Isto é:

package org.casadosimba.loja.conf;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.casadosimba.loja.controllers.HomeController;

@Configuration
@EnableWebMvc
@ComponentScan(basePackageClasses={HomeController.class})
// Também pode usar @ComponentScan(basePackages="org.casadosimba.loja") 
public class AppWebConfiguration {

@Bean
public InternalResourceViewResolver internalResourceViewResolver() {
 InternalResourceViewResolver resolver = new InternalResourceViewResolver();
 resolver.setPrefix("/WEB-INF/views/");
 resolver.setSuffix(".jsp");  
 return resolver;
}
}

Eu estou ainda investigando o porquê de eu receber as mensagens de erro do tomcat... ainda não tive uma conclusão a esse respeito. Você teria uma idéia?

Mais uma vez, obrigado.

Alberto SOUZA

unread,
Apr 13, 2016, 1:06:01 PM4/13/16
to Rodrigo Magalhães, livro-springmvc
O retorno do seu método que está errado, vc está indicando o nome da jsp errada. Você está retornando hello_world, enquanto que o nome do arquivo é hello-world.jsp.


Rodrigo Magalhães

unread,
Apr 13, 2016, 1:52:06 PM4/13/16
to livro-springmvc, rodrigo.r...@gmail.com
Oi, Alberto,

Troquei para hello_world.jsp e não teve efeito.

Alguma outra sugestão?

Obriagdo

Alberto SOUZA

unread,
Apr 13, 2016, 2:40:11 PM4/13/16
to Rodrigo Magalhães, livro-springmvc
Oi Rodrigo, 

Por agora não tenho nenhuma. Vou te pedir para comitar sua alteração e avisar aqui.

Rodrigo Magalhães

unread,
Apr 13, 2016, 2:59:57 PM4/13/16
to livro-springmvc, rodrigo.r...@gmail.com
Oi Alberto,

Acabei de fazer: 75757a3ad4d7216b3493c1220d91e92172acccea

Abraços e obrigado!

Rodrigo

Alberto SOUZA

unread,
Apr 14, 2016, 5:54:55 PM4/14/16
to Rodrigo Magalhães, livro-springmvc

Rodrigo Magalhães

unread,
Apr 21, 2016, 1:03:08 PM4/21/16
to livro-springmvc, rodrigo.r...@gmail.com
Descobri!

Agora na tag: 298f045bf66a489e0423f5326bf9922466b002fa

Eu estou usando o STS e os arquivos .class não estavam sendo carregados. Descobri isso quando me deparei com este artigo:

...[

The Eclipse + Maven problem

In contemporary Java development, there is a trilogy of unfortunate truths:

  1. Eclipse is the most predominant IDE
  2. Maven is the most predominant build system
  3. Eclipse and Maven don’t work very well together

The main problem is that both of these tools are very opinionated about how projects should be built.  Maven has a steep learning curve, and can really dish out punishment should you stray too far from “The Maven Way”.

Meanwhile, unlike NetBeans (which integrates tightly with Maven or Ant), Eclipse is very much entrenched with its own internal build system.  An external build tool such as Maven must be translated into “The Eclipse Way”.

]...

Não acho que a solução dele daria certo neste caso, nem tentei. Mas isso me alertou para o Deployment Path nas propriedades do projeto.

O resumo da ópera é o seguinte: O Eclipse pode errar no deployment path quando importa um arquivo maven e, por causa disso, ele deve ser revisado manualmente. No meu caso, quando o projeto foi importado, ficou assim (arquivos .class sendo buscados de um lugar errado):


Com o ajuste ficou assim:


O Eclipse pegava os arquivos .class da aplicação do lugar errado. Fiz isso e agora o programa funciona, agora posso continuar a leitura do livro. Ufa, esse foi sofrido!

Além disso, quando o arquivo é importado, precisei setar as facets para incluir: Dynamic Web Module. Assim pode-se trabalhar as opções de Deployment Assembly do Eclipse.

De qualquer forma, Alberto, obrigado por estar presente também.

Abraços e continuamos!!

Rodrigo

Jovino JOaquim

unread,
Nov 22, 2018, 6:58:54 PM11/22/18
to livro-springmvc

Captura2r.PNG

Resolvi colocando o Maven no Deployment Assembly nas propriedades do projeto. Quando adicionei, esperei fazer algumas atualizações e funcionou.

Claudio Adriano Starosky

unread,
Jun 4, 2020, 2:36:28 PM6/4/20
to livro-springmvc
Cara também estou tendo o mesmo problema que o seu, como você resolveu?

as imagens que postou não estão aparecendo
Reply all
Reply to author
Forward
0 new messages