WARN org.springframework.web.servlet.PageNotFound

2

I have this error when I want to run a java project with spring

  

WARN org.springframework.web.servlet.PageNotFound - No mapping found   for HTTP request with URI [/ utm /] in DispatcherServlet with name   'springDispatcher'

I attach two images that represent the problem

The web.xml file does not change it, but it is the only one where DispatcherServlet appears

Web.xml file

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
                         http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
     version="3.1">

<display-name>Spring Web App</display-name>

<!-- Definición del Root Spring Container compartido por todos los Servlets
    y Filtros -->
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring/rootContext.xml</param-value>
</context-param>

<!-- Crea el Spring Container compartido por todos los Servlets y Filtros -->
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<!-- Procesa las solicitudes a la aplicación -->
<servlet>
    <servlet-name>springDispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/servletContext.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>springDispatcher</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

<!-- Configuración JSP -->
<jsp-config>
    <jsp-property-group>
        <url-pattern>*.jsp</url-pattern>
        <page-encoding>UTF-8</page-encoding>
        <scripting-invalid>true</scripting-invalid>
        <include-prelude>/WEB-INF/includes/base.jsp</include-prelude>
        <trim-directive-whitespaces>true</trim-directive-whitespaces>
        <default-content-type>text/html</default-content-type>
    </jsp-property-group>
</jsp-config>

<!-- Configuración de la Sesión -->
<session-config>
    <session-timeout>30</session-timeout>
    <cookie-config>
        <http-only>true</http-only>
    </cookie-config>
    <tracking-mode>COOKIE</tracking-mode>
</session-config>

<distributable />

HomeController.java file

package me.jmll.utm;

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

import javax.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
  * Handles requests for the application home page.
*/
@Controller
public class HomeController {
    private HelloService helloService;
    private static final Logger logger = 
LoggerFactory.getLogger(HomeController.class);

/**
 * Simplemente selecciona el template home.jsp para
 * interpretarlo como respuesta
 */
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
    logger.info("Welcome home! The client locale is {}.", locale);

    Date date = new Date();
    DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
    String formattedDate = dateFormat.format(date);
    model.addAttribute("serverTime", formattedDate );

    return "home";
}

/**
 * Crea un Response Body con un servicio en específico.
 */
@ResponseBody
@RequestMapping(value = "/", method = RequestMethod.GET, params = {"name"})
public String homeName(Locale locale, Model model, @RequestParam("name") String name) {
    logger.info("Welcome home! {} The client locale is {}.", name, locale);

    return helloService.getHello(name);
}

/* 4(a) Inyectar HelloService en HomeController */
@Inject
public void setHelloService(HelloService helloService){
    this.helloService = helloService;
 }
}

Server

Console

oct 02, 2018 1:46:09 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:CS_13304' did not find a matching property.
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Server version:        Apache Tomcat/8.5.32
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Server built:          Jun 20 2018 19:50:35 UTC
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Server number:         8.5.32.0
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: OS Name:               Windows 10
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: OS Version:            10.0
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Architecture:          amd64
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Java Home:             C:\Program Files\Java\jre1.8.0_181
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: JVM Version:           1.8.0_181-b13
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: JVM Vendor:            Oracle Corporation
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: CATALINA_BASE:       C:\Users\Santiago\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: CATALINA_HOME:         C:\Program Files\Apache Software Foundation\Tomcat 8.5
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Command line argument: -Dcatalina.base=C:\Users\Santiago\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 8.5
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Command line argument: -Dwtp.deploy=C:\Users\Santiago\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 8.5\endorsed
oct 02, 2018 1:46:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Command line argument: -Dfile.encoding=Cp1252
oct 02, 2018 1:46:09 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFORMACIÓN: 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: 
[C:\Program Files\Java\jre1.8.0_181\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_181/bin/server;C:/Program Files/Java/jre1.8.0_181/bin;C:/Program Files/Java/jre1.8.0_181/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_172\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\xampp\php;C:\composer;C:\Program Files\nodejs\;C:\Users\Santiago\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\Santiago\AppData\Local\GitHubDesktop\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\Santiago\AppData\Roaming\Composer\vendor\bin;C:\Users\Santiago\AppData\Roaming\npm;C:\Windows\system32;;.]

oct 02, 2018 1:46:10 PM org.apache.coyote.AbstractProtocol init
INFORMACIÓN: Initializing ProtocolHandler ["http-nio-8090"]
oct 02, 2018 1:46:10 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMACIÓN: Using a shared selector for servlet write/read
oct 02, 2018 1:46:10 PM org.apache.coyote.AbstractProtocol init
INFORMACIÓN: Initializing ProtocolHandler ["ajp-nio-8009"]
oct 02, 2018 1:46:10 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMACIÓN: Using a shared selector for servlet write/read
oct 02, 2018 1:46:10 PM org.apache.catalina.startup.Catalina load
INFORMACIÓN: Initialization processed in 1088 ms
oct 02, 2018 1:46:10 PM org.apache.catalina.core.StandardService startInternal
INFORMACIÓN: Arrancando servicio [Catalina]
oct 02, 2018 1:46:10 PM org.apache.catalina.core.StandardEngine startInternal
INFORMACIÓN: Starting Servlet Engine: Apache Tomcat/8.5.32
oct 02, 2018 1:46:15 PM org.apache.jasper.servlet.TldScanner scanJars
INFORMACIÓN: Al menos un JAR, que se ha explorado buscando TLDs, aún no contenía TLDs. Activar historial de depuración para este historiador para una completa lista de los JARs que fueron explorados y de los que nos se halló TLDs. Saltarse JARs no necesarios durante la exploración puede dar lugar a una mejora de tiempo significativa en el arranque y compilación de JSP .
oct 02, 2018 1:46:21 PM org.apache.jasper.servlet.TldScanner scanJars
INFORMACIÓN: Al menos un JAR, que se ha explorado buscando TLDs, aún no contenía TLDs. Activar historial de depuración para este historiador para una completa lista de los JARs que fueron explorados y de los que nos se halló TLDs. Saltarse JARs no necesarios durante la exploración puede dar lugar a una mejora de tiempo significativa en el arranque y compilación de JSP .
oct 02, 2018 1:46:21 PM org.apache.catalina.core.ApplicationContext log
INFORMACIÓN: No Spring WebApplicationInitializer types detected on classpath
oct 02, 2018 1:46:22 PM org.apache.catalina.core.ApplicationContext log
INFORMACIÓN: Initializing Spring root WebApplicationContext
13:46:22.667 [localhost-startStop-1] INFO  org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
13:46:22.973 [localhost-startStop-1] INFO  org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Tue Oct 02 13:46:22 CDT 2018]; root of context hierarchy
13:46:23.230 [localhost-startStop-1] INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/rootContext.xml]
13:46:23.630 [localhost-startStop-1] INFO  org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
13:46:23.749 [localhost-startStop-1] INFO  org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 1078 ms
oct 02, 2018 1:46:23 PM org.apache.catalina.core.ApplicationContext log
INFORMACIÓN: Initializing Spring FrameworkServlet 'springDispatcher'
13:46:23.783 [localhost-startStop-1] INFO  org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'springDispatcher': initialization started
13:46:23.792 [localhost-startStop-1] INFO  org.springframework.web.context.support.XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'springDispatcher-servlet': startup date [Tue 
Oct 02 13:46:23 CDT 2018]; parent: Root WebApplicationContext
13:46:23.793 [localhost-startStop-1] INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/servletContext.xml]
13:46:24.105 [localhost-startStop-1] INFO  org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
13:46:24.490 [localhost-startStop-1] INFO  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: WebApplicationContext for namespace 'springDispatcher-servlet': startup date [Tue Oct 02 13:46:23 CDT 2018]; parent: Root WebApplicationContext
13:46:24.571 [localhost-startStop-1] INFO  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: WebApplicationContext for namespace 'springDispatcher-servlet': startup date [Tue Oct 02 13:46:23 CDT 2018]; parent: Root WebApplicationContext
13:46:24.667 [localhost-startStop-1] INFO  org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
13:46:24.756 [localhost-startStop-1] INFO  org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'springDispatcher': initialization completed in 972 ms
oct 02, 2018 1:46:24 PM org.apache.coyote.AbstractProtocol start
INFORMACIÓN: Starting ProtocolHandler ["http-nio-8090"]
oct 02, 2018 1:46:24 PM org.apache.coyote.AbstractProtocol start
INFORMACIÓN: Starting ProtocolHandler ["ajp-nio-8009"]
oct 02, 2018 1:46:24 PM org.apache.catalina.startup.Catalina start
INFORMACIÓN: Server startup in 14481 ms
13:46:25.649 [http-nio-8090-exec-2] WARN  org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/utm/] in DispatcherServlet with name 'springDispatcher'
    
asked by Santiago 02.10.2018 в 06:54
source

0 answers