title: There was an unexpected error (type=Not Found, status=404). - Spring Java
body: <p>I have this service in github <a href="https://github.com/felloz/personsService" rel="nofollow noreferrer">https://github.com/felloz/personsService</a> The application compile with no errors but when im trying to access the route <a href="http://localhost:8080/demo/persons" rel="nofollow noreferrer">http://localhost:8080/demo/persons</a> Im getting this error: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Whitelabel Error Page
  This application has no explicit mapping for /error, so you are seeing this as a fallback.
  
  Mon May 11 14:55:30 VET 2020
  There was an unexpected error (type=Not Found, status=404).
  No message available</code></pre>
  </div>
  </div>
  </p>
  
  <p>The compile message:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> .   ____          _            __ _ _
   /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
  ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
   \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
    '  |____| .__|_| |_|_| |_\__, | / / / /
   =========|_|==============|___/=/_/_/_/
   :: Spring Boot ::        (v2.2.7.RELEASE)
  
  2020-05-11 15:05:55.576  INFO 10476 --- [           main] com.example.demo.DemoApplication         : Starting DemoApplication on lserrano-PC with PID 10476 (C:\JAVA\Eclipse Projects\demo\target\classes started by lserrano in C:\JAVA\Eclipse Projects\demo)
  2020-05-11 15:05:55.592  INFO 10476 --- [           main] com.example.demo.DemoApplication         : No active profile set, falling back to default profiles: default
  2020-05-11 15:05:58.173  INFO 10476 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
  2020-05-11 15:05:58.198  INFO 10476 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
  2020-05-11 15:05:58.198  INFO 10476 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.34]
  2020-05-11 15:05:58.386  INFO 10476 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
  2020-05-11 15:05:58.387  INFO 10476 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2685 ms
  2020-05-11 15:05:58.857  INFO 10476 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
  Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
  2020-05-11 15:05:59.362  INFO 10476 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
  2020-05-11 15:05:59.377  INFO 10476 --- [           main] com.example.demo.DemoApplication         : Started DemoApplication in 4.578 seconds (JVM running for 5.433)
  2020-05-11 15:06:14.712  INFO 10476 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
  2020-05-11 15:06:14.712  INFO 10476 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
  2020-05-11 15:06:14.727  INFO 10476 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 15 ms</code></pre>
  </div>
  </div>
  </p>
  
  <p>You can check the code in the github repo, Im new with Sprong any help will be appreciated, im using NetBeans as IDE.</p>
  
  <p>After adding server.servlet.context-path=/demo</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  .   ____          _            __ _ _
   /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
  ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
   \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
    '  |____| .__|_| |_|_| |_\__, | / / / /
   =========|_|==============|___/=/_/_/_/
   :: Spring Boot ::        (v2.2.7.RELEASE)
  
  2020-05-11 17:26:54.336  INFO 9144 --- [           main] com.example.demo.DemoApplication         : Starting DemoApplication on lserrano-PC with PID 9144 (C:\JAVA\Eclipse Projects\demo\target\classes started by lserrano in C:\JAVA\Eclipse Projects\demo)
  2020-05-11 17:26:54.336  INFO 9144 --- [           main] com.example.demo.DemoApplication         : No active profile set, falling back to default profiles: default
  2020-05-11 17:26:56.926  INFO 9144 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
  2020-05-11 17:26:56.957  INFO 9144 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
  2020-05-11 17:26:56.957  INFO 9144 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.34]
  2020-05-11 17:26:57.160  INFO 9144 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/demo]   : Initializing Spring embedded WebApplicationContext
  2020-05-11 17:26:57.160  INFO 9144 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2715 ms
  2020-05-11 17:26:57.612  INFO 9144 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
  Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
  2020-05-11 17:26:58.111  INFO 9144 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path '/demo'
  2020-05-11 17:26:58.111  INFO 9144 --- [           main] com.example.demo.DemoApplication         : Started DemoApplication in 4.591 seconds (JVM running for 5.464)
  2020-05-11 17:27:14.361  INFO 9144 --- [nio-8080-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/demo]   : Initializing Spring DispatcherServlet 'dispatcherServlet'
  2020-05-11 17:27:14.362  INFO 9144 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
  2020-05-11 17:27:14.379  INFO 9144 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Completed initialization in 17 ms</code></pre>
  </div>
  </div>
  </p>