Announcement Announcement Module
Collapse
No announcement yet.
Servlet and URL Mapping doubts - HTTP 404 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Servlet and URL Mapping doubts - HTTP 404

    (Note: this post has been splitted in 12 replies, in order to provide all details)

    Hi there,

    I am quite new to Spring, and as I am starting my first project I am too facing the first problems. I am sure I am falling in a silly gotcha here, but the thing is I haven't been able to make this work.

    I'll try to explain the issue as much detailed as I can, in case anyone could shed some light on me :-)

    This is the scenario:

    Projects
    • A project that exposes a Web Service that pulls data from a service layer
    • The Spring MVC Showcase sample code

    Tools & Versions
    • Spring 3
    • Tomcat 6.0 (Springsource TC Server)
    • SpringSource Tool Suite (latest version)
    • Mac OS X Leopard
    • Both of the projects mentioned above running perfectly on their own

    What am I trying to do?
    • My project, that exposes the web service, has a mapping that maps requests to /ws/* to expose the wsdl (runs fine)
    • I want to add another mapping to serve JSP pages as well, imitating the MVC Showcase project structure and configuration

    What am I getting?

    Calls to the wsdl, like:

    http://localhost:8080/appname/ws/myservice.wsdl

    shows the wsdl just fine.

    Any request to JSP's or Views end up in a HTTP 404 error:

    http://localhost:8080/appname/jsp/viewname

    My project settings and configuration

    This is my project structure (I include only the part that includes configuration, views and all that important stuff):

    +src
    |--main
    ....|--webapp
    ........|--META-INF
    ........|--WEB-INF
    ............|--etc
    ............|--lib
    ............|--pages
    ................|--404.jsp
    ............|--system
    ...............|--config
    ...................|--appServlet-context.xml
    ...................|--appServlet-servlet.xml
    ...................|--carrerer-ws-servlet.xml
    ...................|--controllers.xml
    ...................|--interceptors-config.xml
    ...................|--marshallers-config.xml
    ...................|--services.xml
    ...................|--wsdl-generator-config.xml
    ...............|--schemas
    ...................|--(the xsd's for our types & methods)
    ............|--views
    ...................|--home.jsp
    ............|--web.xml

    So the project was running perfectly, exposing the carrerer-ws-servlet.xml Web Service through the wsdl-generator-config.xml. My guess is that this is somehow interfering with my mappings to the views (and therefore the JSP's resolving).

    (continues in reply)
    Last edited by Moonwalker; Aug 19th, 2010, 04:34 AM.

  • #2
    Part II

    Here are the contents of the involved files (marked bold in the list above):

    web.xml

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" 
    		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
             version="2.4">
    
    	<!-- Missatge de display, pero no se on? -->
        <display-name>Carrerer</display-name>
    
    	<!-- Posem un nom unic a la propietat webAppRootKey per despres poder-ho recuperar i saber on estem -->
    	<context-param>
    		<param-name>webAppRootKey</param-name>
    		<param-value>carrerer.root</param-value>
    	</context-param>
    
    	<!-- Indiquem on hi ha el fitxer de configuracio de Log4J -->  
        <context-param>  
            <param-name>log4jConfigLocation</param-name>  
            <param-value>/WEB-INF/etc/log4j.xml</param-value>  
        </context-param>  
          
        <!-- Detecta quan la configuracio "log4jConfigLocation" ha sigut carregada o quelcom així -->
        <listener>  
            <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>  
        </listener>
    
    	<!-- Configuracio dels serveis l'aplicacio -->
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
    			/WEB-INF/system/config/services.xml
    			/WEB-INF/system/config/crontab.xml
    		</param-value>
    	</context-param>
    	
    	<!-- Detecta quan la configuracio "contextConfigLocation" ha sigut carregada o quelcom així -->
    	<listener>
     		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    	
    	<servlet>
    		<servlet-name>appServlet</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value>
    				/WEB-INF/system/config/appServlet-servlet.xml
    			</param-value>
    		</init-param> 
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	
        <!-- JSP Mapping -->	
    	 
    	<servlet-mapping>
    		<servlet-name>appServlet</servlet-name>
    		<url-pattern>/jsp/*</url-pattern>
    	</servlet-mapping>
    	
    	<!-- Indiquem que tenin un message dispacher amb nom linneo-ws -->
        <servlet>
            <servlet-name>carrerer-ws</servlet-name>
            <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
        	<init-param>
        		<param-name>contextConfigLocation</param-name>
    			<param-value>
    				/WEB-INF/system/config/marshallers-config.xml
    				/WEB-INF/system/config/interceptors-config.xml
    				/WEB-INF/system/config/wsdl-generator-config.xml
    				/WEB-INF/system/config/carrerer-ws-servlet.xml
    			</param-value>
    		</init-param>
        </servlet>    
    	
    	<!-- Creem el mapping de les url cap als servlets, en aquest cas tot -->
    
        <servlet-mapping>
            <servlet-name>carrerer-ws</servlet-name>
            <url-pattern>/ws/*</url-pattern>
        </servlet-mapping>
        
    	<!-- Disables Servlet Container welcome file handling. Needed for compatibility with Servlet 3.0 and Tomcat 7.0 -->
    	<welcome-file-list>
    		<welcome-file></welcome-file>
    	</welcome-file-list>    
    	
    	<error-page>
    		<error-code>404</error-code>
    		<location>/WEB-INF/pages/404.jsp</location>
    	</error-page>
        
    </web-app>
    (continues in reply)

    Comment


    • #3
      Part III

      (Since the web service works just fine I won't put here it's -servlet.xml & -config.xml files)

      /WEB-INF/system/config/appServlet-servlet.xml

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <beans:beans xmlns="http://www.springframework.org/schema/mvc"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xmlns:mvc="http://www.springframework.org/schema/mvc"
      	xmlns:context="http://www.springframework.org/schema/context"
      	xmlns:beans="http://www.springframework.org/schema/beans"
      	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
      		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
      
              
      	<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
      	<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
      		<beans:property name="prefix" value="/WEB-INF/views/" />
      		<beans:property name="suffix" value=".jsp" />
      	</beans:bean>
      
      	<!-- Maps '/' requests to the 'home' view -->
      	<mvc:view-controller path="/" view-name="home"/>
      		
      </beans:beans>
      When I cloned the Spring MVC Showcase project config files, I also added this next file to mine, but I removed it while testing (it doesn't make any difference having it enabled or removed). It was a in web.xml, as a contextConfigLocation param of my appServlet (org.springframework.web.servlet.DispatcherServlet)

      /WEB-INF/system/config/appServlet-context.xml

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <beans:beans xmlns="http://www.springframework.org/schema/mvc"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xmlns:beans="http://www.springframework.org/schema/beans"
      	xsi:schemaLocation="
              http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
              http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
      
      	<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
      	
      	<!-- Enables the Spring MVC @Controller programming model -->
      	<!-- <annotation-driven conversion-service="conversionService" />  -->
      
      	<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources/ directory -->
      	<!-- <resources mapping="/resources/**" location="/resources/" />  -->
      
      	<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
      	<!-- 
      	<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
      		<beans:property name="prefix" value="/WEB-INF/views/" />
      		<beans:property name="suffix" value=".jsp" />
      	</beans:bean>
      	 -->
      	<!-- Imports user-defined @Controller beans that process client requests -->
      	<beans:import resource="controllers.xml" />
      
      	<!-- Only needed because we install custom converters to support the examples in the org.springframewok.samples.mvc.convert package -->
      	<!-- <beans:bean id="conversionService" class="org.springframework.samples.mvc.convert.CustomConversionServiceFactoryBean" />  -->
      
      	<!-- Only needed because we require fileupload in the org.springframework.samples.mvc.fileupload package -->
      	<!-- <beans:bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />  -->
      	
      </beans:beans>
      which imports:

      controllers.xml

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xmlns:mvc="http://www.springframework.org/schema/mvc"
      	xmlns:context="http://www.springframework.org/schema/context"
      	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
      		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
      
      	<!-- Maps '/jsp/' requests to the 'home' view -->
      	<!-- <mvc:view-controller path="/web/" view-name="home"/>  -->
      	
      	<context:component-scan base-package="com.grupogodo.it.projects.carrerer.web" />
      	 
      </beans>
      Please note that appServlet-context.xml has the InternalResourceViewResolver bean commented, but it is enabled in appServlet-servlet.xml, which is the file I am using.

      Also, the file that maybe is to blame:

      wsdl-generator-config.xml

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans" 
      	   xmlns:p="http://www.springframework.org/schema/p"
      	   xmlns:context="http://www.springframework.org/schema/context" 
      	   xmlns:jee="http://www.springframework.org/schema/jee"
      	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation=
             		"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      			http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
      
      	<!-- Definicio d'una Schema Collection -->
      	<bean id="schemaCollection" class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
      	    <description>
      	        This bean wrap the messages.xsd (which imports types.xsd), and inlines them as a one.
      	    </description>
      	    <property name="xsds">
      	        <list>	
      				<value>/WEB-INF/system/schemas/FindCountryMethod.xsd</value>
      				<value>/WEB-INF/system/schemas/FindLanguageMethod.xsd</value>
      				<value>/WEB-INF/system/schemas/SyncroSapMethod.xsd</value>
      				<value>/WEB-INF/system/schemas/FindAdministrativeAreaMethod.xsd</value>
      				<value>/WEB-INF/system/schemas/FindSubAdministrativeAreaMethod.xsd</value>
      				<value>/WEB-INF/system/schemas/FindSubSubAdministrativeAreaMethod.xsd</value>
      				<value>/WEB-INF/system/schemas/FindLocalityMethod.xsd</value>
      				<value>/WEB-INF/system/schemas/FindDependentLocalityMethod.xsd</value>
      				<value>/WEB-INF/system/schemas/FindThoroughFareMethod.xsd</value>
      			</list>
      	    </property>
          	<property name="inline" value="true"/>
      	</bean>
      			
          <!-- Aixo publicara el WSDL a http://localhost:8080/carrerer/ws/carrerer-ws.wsdl -->
          <bean id="carrerer-ws" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
      		<property name="schemaCollection" ref="schemaCollection" />
      		
      		<property name="requestSuffix" value="Request" />
      		<property name="responseSuffix" value="Response" />
      		
      		<property name="portTypeName" value="CarrererWS"/>
      		<property name="locationUri" value="http://localhost:8080/carrerer/ws/"/>
      <!--		<property name="locationUri" value="http://srvdes01:8080/carrerer/ws/"/>-->
      	</bean>
      </beans>
      (to be continued...)
      Last edited by Moonwalker; Aug 19th, 2010, 04:35 AM.

      Comment


      • #4
        Part IV (getting long, huh?)

        And maybe even
        interceptors-config.xml

        Code:
        <?xml version="1.0" encoding="UTF-8"?>
        <beans xmlns="http://www.springframework.org/schema/beans" 
        	   xmlns:p="http://www.springframework.org/schema/p"
        	   xmlns:context="http://www.springframework.org/schema/context" 
        	   xmlns:jee="http://www.springframework.org/schema/jee"
        	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation=
               		"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        			http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
            
        	<!-- Declarem el logginInterceptor, classe que ha de controlar el loggin -->
        	<bean id="loggingInterceptor" class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor">
             	<property name="logRequest" value="true"/>
        		<property name="logResponse" value="true"/>
        	</bean>
            
        	<!-- Declarem el validador per comprovar el format de les peticions i les respostes -->   
        	<bean id="validatingInterceptor"  class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">  
        		<!-- <property name="xsdSchemaCollection" ref="schemaCollection" /> -->
        		<property name="schema" value="/WEB-INF/system/schemas/CarrererServiceMethods.xsd" />
        		<property name="validateRequest"  value="true"/>  
        		<property name="validateResponse" value="true"/>  
        	</bean>  
        	
        	<!-- Declarem el Security Intercepter -->
        	<bean id="wsSecurityInterceptor"  class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
        		<property name="validationCallbackHandler" ref="authenticationHandler"/>
        		<property name="validationActions" value="UsernameToken"/>
        		<property name="securementActions" value="NoSecurity"/>
            </bean>
            
            <!-- Declarem el handler per l'autentificacio, es posem un de basic on el password estan aqui mateix -->
        	<bean id="authenticationHandler" class="org.springframework.ws.soap.security.wss4j.callback.SimplePasswordValidationCallbackHandler">
            	<property name="users">
                	<props>
                    	<prop key="test">test</prop>
                	</props>
            	</property>
        	</bean>
        </beans>
        Additionally, I have this simple controller for testing purposes:
        com.grupogodo.it.projects.carrerer.web.SimpleContr oller.java
        Code:
        package com.grupogodo.it.projects.carrerer.web;
        
        import org.springframework.stereotype.Controller;
        import org.springframework.web.bind.annotation.RequestMapping;
        import org.springframework.web.bind.annotation.ResponseBody;
        
        @Controller
        public class SimpleController {
        
        	@RequestMapping("/simple")
        	public @ResponseBody String simple() {
        		return "Hello world!";
        	}
        }
        I added to see what this line in controllers.xml really does:
        Code:
        	<context:component-scan base-package="com.grupogodo.it.projects.carrerer.web" />
        What am I doing wrong?

        To sumarize:
        • I don't know what I am missing
        • I get no log information whatsoever
        • When I run the MVC Showcase sample project, the log gets filled with INFO while initializing the appServlet. I attach log information for both at the end of this post
        • I get a HTTP 404 error when trying to access the JSP page
        • I see the custom 404.jsp correctly (at least THAT works)

        (to be continued...)

        Comment


        • #5
          Part V

          Log info when starting the Spring MVC Showcase sample code:

          Code:
          19-ago-2010 10:39:30 org.apache.catalina.core.AprLifecycleListener init
          INFO: La biblioteca nativa de Apache Tomcat basada en ARP que permite un rendimiento óptimo en entornos de desarrollo no ha sido hallada en java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
          19-ago-2010 10:39:30 org.apache.tomcat.util.digester.SetPropertiesRule begin
          ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:mvc-showcase' did not find a matching property.
          19-ago-2010 10:39:30 org.apache.coyote.http11.Http11Protocol init
          INFO: Inicializando Coyote HTTP/1.1 en puerto http-8080
          19-ago-2010 10:39:30 org.apache.catalina.startup.Catalina load
          INFO: Initialization processed in 1213 ms
          19-ago-2010 10:39:30 org.apache.catalina.core.StandardService start
          INFO: Arrancando servicio Catalina
          19-ago-2010 10:39:30 org.apache.catalina.core.StandardEngine start
          INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
          19-ago-2010 10:39:32 org.apache.catalina.core.ApplicationContext log
          INFO: Initializing Spring root WebApplicationContext
          INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
          INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Thu Aug 19 10:39:32 CEST 2010]; root of context hierarchy
          INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/root-context.xml]
          DEBUG: org.springframework.web.context.support.XmlWebApplicationContext - Bean factory for Root WebApplicationContext: org.springframework.beans.factory.support.DefaultListableBeanFactory@60c9630a: defining beans []; root of factory hierarchy
          DEBUG: org.springframework.web.context.support.XmlWebApplicationContext - Unable to locate MessageSource with name 'messageSource': using default [[email protected]e2]
          DEBUG: org.springframework.web.context.support.XmlWebApplicationContext - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@4d480ea]
          INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@60c9630a: defining beans []; root of factory hierarchy
          DEBUG: org.springframework.web.context.support.XmlWebApplicationContext - Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [[email protected]abd2b]
          DEBUG: org.springframework.web.context.ContextLoader - Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]
          INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 403 ms
          DEBUG: org.springframework.web.servlet.DispatcherServlet - Initializing servlet 'appServlet'
          19-ago-2010 10:39:32 org.apache.catalina.core.ApplicationContext log
          INFO: Initializing Spring FrameworkServlet 'appServlet'
          INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'appServlet': initialization started
          DEBUG: org.springframework.web.servlet.DispatcherServlet - Servlet with name 'appServlet' will try to create custom WebApplicationContext context of class 'org.springframework.web.context.support.XmlWebApplicationContext', using parent context [Root WebApplicationContext: startup date [Thu Aug 19 10:39:32 CEST 2010]; root of context hierarchy]
          INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'appServlet-servlet': startup date [Thu Aug 19 10:39:32 CEST 2010]; parent: Root WebApplicationContext
          INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]
          INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/appServlet/controllers.xml]
          INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
          DEBUG: org.springframework.web.context.support.XmlWebApplicationContext - Bean factory for WebApplicationContext for namespace 'appServlet-servlet': org.springframework.beans.factory.support.DefaultListableBeanFactory@f786a3c: defining beans [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.view.InternalResourceViewResolver#0,org.springframework.web.servlet.config.viewControllerHandlerAdapter,org.springframework.web.servlet.config.viewControllerHandlerMapping,convertController,customArgumentController,requestDataController,standardArgumentsController,exceptionController,fileUploadController,formController,classlevelMappingController,mappingController,messageConvertersController,responseController,simpleController,simpleControllerRevisited,validationController,viewsController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,conversionService,multipartResolver]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@60c9630a
          INFO : org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
          DEBUG: org.springframework.web.context.support.XmlWebApplicationContext - Unable to locate MessageSource with name 'messageSource': using default [[email protected]077]
          DEBUG: org.springframework.web.context.support.XmlWebApplicationContext - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@6e3e5a91]
          INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@f786a3c: defining beans [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.view.InternalResourceViewResolver#0,org.springframework.web.servlet.config.viewControllerHandlerAdapter,org.springframework.web.servlet.config.viewControllerHandlerMapping,convertController,customArgumentController,requestDataController,standardArgumentsController,exceptionController,fileUploadController,formController,classlevelMappingController,mappingController,messageConvertersController,responseController,simpleController,simpleControllerRevisited,validationController,viewsController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,conversionService,multipartResolver]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@60c9630a
          DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Looking for URL mappings in application context: WebApplicationContext for namespace 'appServlet-servlet': startup date [Thu Aug 19 10:39:32 CEST 2010]; parent: Root WebApplicationContext
          (continues...)

          Comment


          • #6
            Part VI

            Code:
            DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': no URL paths identified
            DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': no URL paths identified
            DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0': no URL paths identified
            DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.web.servlet.handler.MappedInterceptor#0': no URL paths identified
            DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter': no URL paths identified
            DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0': no URL paths identified
            DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0': no URL paths identified
            DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.web.servlet.view.InternalResourceViewResolver#0': no URL paths identified
            DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.web.servlet.config.viewControllerHandlerAdapter': no URL paths identified
            DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.web.servlet.config.viewControllerHandlerMapping': no URL paths identified
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/date/{value}] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/date/{value}.*] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/date/{value}/] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/bean] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/bean.*] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/bean/] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/collection] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/collection.*] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/collection/] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/custom] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/custom.*] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/custom/] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/primitive] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/primitive.*] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/primitive/] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/formattedCollection] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/formattedCollection.*] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/formattedCollection/] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/value] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/value.*] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/convert/value/] onto handler 'convertController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/custom] onto handler 'customArgumentController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/custom.*] onto handler 'customArgumentController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/custom/] onto handler 'customArgumentController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/param] onto handler 'requestDataController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/param.*] onto handler 'requestDataController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/param/] onto handler 'requestDataController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/group] onto handler 'requestDataController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/group.*] onto handler 'requestDataController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/group/] onto handler 'requestDataController'
            INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/path/{var}] onto handler 'requestDataController'
            (continues...)

            Comment


            • #7
              Part VII

              Code:
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/path/{var}.*] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/path/{var}/] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/header] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/header.*] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/header/] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/cookie] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/cookie.*] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/cookie/] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/body] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/body.*] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/body/] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/entity] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/entity.*] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/entity/] onto handler 'requestDataController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/response] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/response.*] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/response/] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/session] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/session.*] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/session/] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/request] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/request.*] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/request/] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/request/reader] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/request/reader.*] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/request/reader/] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/request/is] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/request/is.*] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/request/is/] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/response/writer] onto handler 'standardArgumentsController'
              INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/response/writer.*] onto handler 'standardArgumentsController'
              (continues...)

              Comment


              • #8
                Part VIII

                Code:
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/response/writer/] onto handler 'standardArgumentsController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/response/os] onto handler 'standardArgumentsController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/response/os.*] onto handler 'standardArgumentsController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/data/standard/response/os/] onto handler 'standardArgumentsController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/exception] onto handler 'exceptionController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/exception.*] onto handler 'exceptionController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/exception/] onto handler 'exceptionController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/fileupload] onto handler 'fileUploadController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/fileupload.*] onto handler 'fileUploadController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/fileupload/] onto handler 'fileUploadController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/form] onto handler 'formController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/form.*] onto handler 'formController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/form/] onto handler 'formController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/path] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/path.*] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/path/] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/method] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/method.*] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/method/] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/parameter] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/parameter.*] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/parameter/] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/header] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/header.*] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/header/] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/notheader] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/notheader.*] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/notheader/] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/*] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/*.*] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/class-mapping/*/] onto handler 'classlevelMappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/path] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/path.*] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/path/] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/method] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/method.*] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/method/] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/parameter] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/parameter.*] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/parameter/] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/header] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/header.*] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/header/] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/notheader] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/notheader.*] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/notheader/] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/*] onto handler 'mappingController'
                INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/*.*] onto handler 'mappingController'
                (guess what, it still goes on...)

                Comment


                • #9
                  Part IX

                  Code:
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/mapping/*/] onto handler 'mappingController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/string] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/string.*] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/string/] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/xml] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/xml.*] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/xml/] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/form] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/form.*] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/form/] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/json] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/json.*] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/json/] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/atom] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/atom.*] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/atom/] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/rss] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/rss.*] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/messageconverters/rss/] onto handler 'messageConvertersController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/response/annotation] onto handler 'responseController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/response/annotation.*] onto handler 'responseController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/response/annotation/] onto handler 'responseController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/response/entity/status] onto handler 'responseController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/response/entity/status.*] onto handler 'responseController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/response/entity/status/] onto handler 'responseController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/response/entity/headers] onto handler 'responseController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/response/entity/headers.*] onto handler 'responseController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/response/entity/headers/] onto handler 'responseController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/simple] onto handler 'simpleController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/simple.*] onto handler 'simpleController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/simple/] onto handler 'simpleController'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/simple/revisited] onto handler 'simpleControllerRevisited'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/simple/revisited.*] onto handler 'simpleControllerRevisited'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/simple/revisited/] onto handler 'simpleControllerRevisited'
                  INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/validate] onto handler 'validationController'
                  (continues...)

                  Comment


                  • #10
                    Part X (this one is relevant)

                    Code:
                    INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/validate.*] onto handler 'validationController'
                    INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/validate/] onto handler 'validationController'
                    INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/views/html] onto handler 'viewsController'
                    INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/views/html.*] onto handler 'viewsController'
                    INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/views/html/] onto handler 'viewsController'
                    INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/views/viewName] onto handler 'viewsController'
                    INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/views/viewName.*] onto handler 'viewsController'
                    INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/views/viewName/] onto handler 'viewsController'
                    DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor': no URL paths identified
                    DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor': no URL paths identified
                    DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalRequiredAnnotationProcessor': no URL paths identified
                    DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalCommonAnnotationProcessor': no URL paths identified
                    DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'conversionService': no URL paths identified
                    DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'multipartResolver': no URL paths identified
                    DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'servletConfig': no URL paths identified
                    DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'messageSource': no URL paths identified
                    DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'applicationEventMulticaster': no URL paths identified
                    INFO : org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
                    INFO : org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Root mapping to handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
                    DEBUG: org.springframework.web.context.support.XmlWebApplicationContext - Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [[email protected]b24d3]
                    DEBUG: org.springframework.web.servlet.DispatcherServlet - Using MultipartResolver [org.springframework.web.multipart.commons.CommonsMultipartResolver@7f2ea1dd]
                    DEBUG: org.springframework.web.servlet.DispatcherServlet - Unable to locate LocaleResolver with name 'localeResolver': using default [org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver@4ad2efa1]
                    DEBUG: org.springframework.web.servlet.DispatcherServlet - Unable to locate ThemeResolver with name 'themeResolver': using default [[email protected]]
                    DEBUG: org.springframework.web.servlet.DispatcherServlet - No HandlerExceptionResolvers found in servlet 'appServlet': using default
                    DEBUG: org.springframework.web.servlet.DispatcherServlet - Unable to locate RequestToViewNameTranslator with name 'viewNameTranslator': using default [org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@3857dc15]
                    DEBUG: org.springframework.web.servlet.DispatcherServlet - Published WebApplicationContext of servlet 'appServlet' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.appServlet]
                    INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'appServlet': initialization completed in 3501 ms
                    DEBUG: org.springframework.web.servlet.DispatcherServlet - Servlet 'appServlet' configured successfully
                    19-ago-2010 10:39:36 org.apache.coyote.http11.Http11Protocol start
                    INFO: Arrancando Coyote HTTP/1.1 en puerto http-8080
                    19-ago-2010 10:39:36 org.apache.jk.common.ChannelSocket init
                    INFO: JK: ajp13 listening on /0.0.0.0:8009
                    19-ago-2010 10:39:36 org.apache.jk.server.JkMain start
                    INFO: Jk running ID=0 time=0/58  config=null
                    19-ago-2010 10:39:36 org.apache.catalina.startup.Catalina start
                    INFO: Server startup in 5790 ms
                    Looks like all of the verbose logging was because of the appServlet, because it ends up with:
                    INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'appServlet': initialization completed in 3501 ms
                    (Continues...)

                    Comment


                    • #11
                      Part XI (relevant, too)

                      I won't include all of them but seems that there is a log event for every URL match, like my beloved /WEB-INF/views/home.jsp:

                      Code:
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'appServlet' processing GET request for [/mvc-showcase/]
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/] to HandlerExecutionChain with handler [org.springframework.web.servlet.mvc.ParameterizableViewController@56d99277] and 2 interceptors
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/mvc-showcase/] is: -1
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Rendering view [org.springframework.web.servlet.view.JstlView: name 'home'; URL [/WEB-INF/views/home.jsp]] in DispatcherServlet with name 'appServlet'
                      DEBUG: org.springframework.web.servlet.view.JstlView - Forwarding to resource [/WEB-INF/views/home.jsp] in InternalResourceView 'home'
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Successfully completed request
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'appServlet' processing GET request for [/mvc-showcase/resources/form.css]
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Matching patterns for request [/resources/form.css] are [/resources/**]
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - URI Template variables for request [/resources/form.css] are {}
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/resources/form.css] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@372eabae] and 2 interceptors
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/mvc-showcase/resources/form.css] is: -1
                      DEBUG: org.springframework.web.servlet.resource.ResourceHttpRequestHandler - Trying relative path [form.css] against base location: ServletContext resource [/resources/]
                      DEBUG: org.springframework.web.servlet.resource.ResourceHttpRequestHandler - Found matching resource: ServletContext resource [/resources/form.css]
                      DEBUG: org.springframework.web.servlet.resource.ResourceHttpRequestHandler - Determined media type [text/css] for ServletContext resource [/resources/form.css]
                      DEBUG: org.springframework.web.servlet.resource.ResourceHttpRequestHandler - Resource not modified - returning 304
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'appServlet': assuming HandlerAdapter completed request handling
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Successfully completed request
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'appServlet' processing GET request for [/mvc-showcase/resources/jqueryui/1.8/themes/base/jquery.ui.all.css]
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Matching patterns for request [/resources/jqueryui/1.8/themes/base/jquery.ui.all.css] are [/resources/**]
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'appServlet' processing GET request for [/mvc-showcase/resources/jquery/1.4/jquery.js]
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Matching patterns for request [/resources/jquery/1.4/jquery.js] are [/resources/**]
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - URI Template variables for request [/resources/jquery/1.4/jquery.js] are {}
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/resources/jquery/1.4/jquery.js] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@372eabae] and 2 interceptors
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/mvc-showcase/resources/jquery/1.4/jquery.js] is: -1
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - URI Template variables for request [/resources/jqueryui/1.8/themes/base/jquery.ui.all.css] are {}
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/resources/jqueryui/1.8/themes/base/jquery.ui.all.css] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@372eabae] and 2 interceptors
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/mvc-showcase/resources/jqueryui/1.8/themes/base/jquery.ui.all.css] is: -1
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'appServlet' processing GET request for [/mvc-showcase/resources/jqueryform/2.4/jquery.form.js]
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Matching patterns for request [/resources/jqueryform/2.4/jquery.form.js] are [/resources/**]
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - URI Template variables for request [/resources/jqueryform/2.4/jquery.form.js] are {}
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/resources/jqueryform/2.4/jquery.form.js] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@372eabae] and 2 interceptors
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/mvc-showcase/resources/jqueryform/2.4/jquery.form.js] is: -1
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'appServlet' processing GET request for [/mvc-showcase/resources/jqueryui/1.8/jquery.ui.core.js]
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Matching patterns for request [/resources/jqueryui/1.8/jquery.ui.core.js] are [/resources/**]
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'appServlet' processing GET request for [/mvc-showcase/resources/jqueryui/1.8/jquery.ui.widget.js]
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - URI Template variables for request [/resources/jqueryui/1.8/jquery.ui.core.js] are {}
                      DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/resources/jqueryui/1.8/jquery.ui.core.js] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@372eabae] and 2 interceptors
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/mvc-showcase/resources/jqueryui/1.8/jquery.ui.core.js] is: -1
                      DEBUG: org.springframework.web.servlet.resource.ResourceHttpRequestHandler - Trying relative path [jqueryui/1.8/jquery.ui.core.js] against base location: ServletContext resource [/resources/]
                      DEBUG: org.springframework.web.servlet.resource.ResourceHttpRequestHandler - Found matching resource: ServletContext resource [/resources/jqueryui/1.8/jquery.ui.core.js]
                      DEBUG: org.springframework.web.servlet.resource.ResourceHttpRequestHandler - Determined media type [text/javascript] for ServletContext resource [/resources/jqueryui/1.8/jquery.ui.core.js]
                      DEBUG: org.springframework.web.servlet.resource.ResourceHttpRequestHandler - Resource not modified - returning 304
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'appServlet': assuming HandlerAdapter completed request handling
                      DEBUG: org.springframework.web.servlet.DispatcherServlet - Successfully completed request
                      (Continues...)

                      Comment


                      • #12
                        Part XII - And finally, MY log (shorter)

                        Log for my project:

                        Code:
                        19-ago-2010 10:40:53 org.apache.catalina.core.AprLifecycleListener init
                        INFO: La biblioteca nativa de Apache Tomcat basada en ARP que permite un rendimiento óptimo en entornos de desarrollo no ha sido hallada en java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
                        19-ago-2010 10:40:53 org.apache.tomcat.util.digester.SetPropertiesRule begin
                        ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:carrerer' did not find a matching property.
                        19-ago-2010 10:40:53 org.apache.coyote.http11.Http11Protocol init
                        INFO: Inicializando Coyote HTTP/1.1 en puerto http-8080
                        19-ago-2010 10:40:53 org.apache.catalina.startup.Catalina load
                        INFO: Initialization processed in 793 ms
                        19-ago-2010 10:40:53 org.apache.catalina.core.StandardService start
                        INFO: Arrancando servicio Catalina
                        19-ago-2010 10:40:53 org.apache.catalina.core.StandardEngine start
                        INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
                        19-ago-2010 10:40:54 org.apache.catalina.core.ApplicationContext log
                        INFO: Set web app root system property: 'carrerer.root' = [/Users/lserrano/Documents/workspace-sts-2.3.2.RELEASE/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/carrerer/]
                        19-ago-2010 10:40:54 org.apache.catalina.core.ApplicationContext log
                        INFO: Initializing log4j from [/Users/lserrano/Documents/workspace-sts-2.3.2.RELEASE/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/carrerer/WEB-INF/etc/log4j.xml]
                        19-ago-2010 10:40:54 org.apache.catalina.core.ApplicationContext log
                        INFO: Initializing Spring root WebApplicationContext
                        DEBUG JdbcTemplateCarrererMaintenanceService - JdbcTemplateCarrererService()
                        DEBUG JdbcTemplateCarrererMaintenanceService - JdbcTemplateCarrererService()
                        DEBUG JdbcTemplateCarrererMaintenanceService - JdbcTemplateCarrererMaintenanceService()
                        19-ago-2010 10:40:55 org.apache.catalina.core.ApplicationContext log
                        INFO: Initializing Spring FrameworkServlet 'appServlet'
                        19-ago-2010 10:40:55 org.apache.coyote.http11.Http11Protocol start
                        INFO: Arrancando Coyote HTTP/1.1 en puerto http-8080
                        19-ago-2010 10:40:56 org.apache.jk.common.ChannelSocket init
                        INFO: JK: ajp13 listening on /0.0.0.0:8009
                        19-ago-2010 10:40:56 org.apache.jk.server.JkMain start
                        INFO: Jk running ID=0 time=0/84  config=null
                        19-ago-2010 10:40:56 org.apache.catalina.startup.Catalina start
                        INFO: Server startup in 2725 ms
                        As you can see, both show this message:

                        INFO: Initializing Spring FrameworkServlet 'appServlet'
                        but the first log (the huge one in previous replies) makes me think that something is going on, whilst mine seems like a sad deserted call in the middle of nowhere, resulting in no effect whatsoever

                        Well, if anyone has done it until here, thank you already for reading.

                        Any tip or help would be greatly appreciated. Please bear in mind that I am quite new to all the Spring goodness, and I am still in need of a touch of gentleness when talking of details about configurations, controllers, annotations, AutoWired and the rest of such spring-ly vocabulary (plus English is not my primary language, which makes the writting of this post a bit funnier).

                        Thank you in advance!!!

                        Luis Serrano
                        Barcelona - Spain

                        Servlet and URL Mapping doubts - HTTP 404
                        mapping, DispatcherServlet, web.xml, 404 error, JSP

                        Comment


                        • #13
                          Hola,

                          I think I located the source of your problems. In your appServlet-servlet.xml, try to add the following line:

                          Code:
                          <mvc:annotation-driven/>
                          Also, put all bean definitions of classes annotated with @Controller inside this file. The way you are configuring things now, your controllers aren't being scanned at all.

                          I also noted many more incongruencies and oddities in your configuration (e.g. you probably didn't understand at all the concept of separation between core Spring config loaded with listener and Spring web mvc config loaded with DispatcherServlet context-param), which makes me suggest you need to study a little bit more the Spring documentation and try simple examples before building something complex like you are trying to do.

                          Comment


                          • #14
                            Thank you Enrico,

                            I added this:

                            Code:
                            <mvc:annotation-driven/>
                            before your reply, because I saw it somewhere. It still makes no difference, although adding this:

                            Code:
                            	<!-- Maps '/' requests to the 'home' view -->
                            	<mvc:view-controller path="/" view-name="home"/>
                            	
                            	<context:component-scan base-package="com.grupogodo.it.projects.carrerer.web" />
                            	<context:annotation-config/>
                            now allows me to see the "home" view when I access my application root URL. It doesn't work if I specify the "home" view myself, or other views, which makes me think I haven`t fixed anything just yet.

                            By the way, you suggested that by adding this:

                            Code:
                            <context:component-scan base-package="com.grupogodo.it.projects.carrerer.web" />
                            	<context:annotation-config/>
                            I should be adding the beans definition to appServlet-servlet.xml. I've done that, like this:
                            Code:
                            	<beans:bean id="SimpleController" class="com.grupogodo.it.projects.carrerer.web.SimpleController">
                            	</beans:bean>
                            And I have created such class within the specified package:

                            Code:
                            package com.grupogodo.it.projects.carrerer.web;
                            import org.springframework.stereotype.Controller;
                            import org.springframework.web.bind.annotation.RequestMapping;
                            import org.springframework.web.bind.annotation.RequestMethod;
                            
                            @Controller
                            @RequestMapping(value="/simple/*")
                            public class SimpleController {
                            
                            	@RequestMapping(value="/prueba", method=RequestMethod.GET)
                            	public String simple() {
                            		return "Controlador simple!!";
                            	}
                            
                            }
                            But it results in a ClassNotFoundException:

                            Code:
                            GRAVE: StandardWrapper.Throwable
                            org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.grupogodo.it.projects.carrerer.web.SimpleController] for bean with name 'SimpleController' defined in ServletContext resource [/WEB-INF/system/config/appServlet-context.xml]; nested exception is java.lang.ClassNotFoundException: com.grupogodo.it.projects.carrerer.web.SimpleController
                            Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.grupogodo.it.projects.carrerer.web.SimpleController] for bean with name 'SimpleController' defined in ServletContext resource [/WEB-INF/system/config/appServlet-context.xml]; nested exception is java.lang.ClassNotFoundException: com.grupogodo.it.projects.carrerer.web.SimpleController
                            	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
                            	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
                            	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
                            	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
                            	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
                            	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
                            	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574)
                            	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
                            	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
                            	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
                            	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
                            	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
                            	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
                            	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
                            	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
                            	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
                            	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
                            	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
                            	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
                            	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                            	at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
                            	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                            	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
                            	at org.apache.catalina.core.StandardService.start(StandardService.java:519)
                            	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
                            	at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            	at java.lang.reflect.Method.invoke(Method.java:597)
                            	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
                            	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
                            I am not sure whether it is required to define that bean in this file, I haven't seen it in the examples I've read.

                            Any idea?

                            Comment


                            • #15
                              1) mvc:annotation-driven SUBSTITUTES context:component-scan for controllers; thus in a correct configuration you should have mvc:annotation-driven in your dispatcherservlet-specific file (i.e. the webmvc config) AND (optionally) a context:component-scan directive in the Spring core main configuration (i.e. the non-mvc related) which scans packages OTHER than controller packages for other annotations like @Service, @Transactional etc (if you don't exclude your controller packages, the controllers will get scanned twice). mvc:annotation-driven is far better than simple component scan for controllers since it gives you full web mvc configuration in just one line;

                              2) annotation-driven and component-scan will only scan for classes inside the application context. If you don't register a class as a Spring bean with the <bean> tag in the correct xml config file, you can put all annotations you want inside it, but Spring will simply ignore them. Thus, you must register ALL your controllers as Spring beans in the correct xml (the one loaded by DispatcherServlet) or else they won't be controllers (in fact they won't ever be part of your context and you won't be able to use them; don't you use dependency injection to inject services etc in your controllers? If not, you really haven't understood what Spring is).

                              I could go on like forever, but I just can't condensate a full Spring lesson in a forum thread, so I strongly suggest you start studying books & documentation about Spring before you try to set up your own complex project by copying from examples you don't understand...

                              Comment

                              Working...
                              X