title: Error resolving template [users/list], template might not exist or might not be accessible by any of the configured Template Resolvers
body: <p>I am trying to experiment with Thymeleaf and Spring-boot. I have tried with my helloworld controller and it works fine. But when I create a new user controller and trying to play with ModelAndView object I am getting a template engine exception like this:</p>
  
  <pre><code>2019-07-23 17:35:43.427 ERROR 22272 --- [nio-8080-exec-1] org.thymeleaf.TemplateEngine             : [THYMELEAF][http-nio-8080-exec-1] Exception processing template "/users/list": Error resolving template [/users/list], template might not exist or might not be accessible by any of the configured Template Resolvers
  
  org.thymeleaf.exceptions.TemplateInputException: Error resolving template [/users/list], template might not exist or might not be accessible by any of the configured Template Resolvers
      at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:869) ~[thymeleaf-3.0.11.RELEASE.jar!/:3.0.11.RELEASE]
      at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:607) ~[thymeleaf-3.0.11.RELEASE.jar!/:3.0.11.RELEASE]
  </code></pre>
  
  <p>Here is my pom:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.1.6.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;com.black.spring.boot.eventsharing&lt;/groupId&gt;
      &lt;artifactId&gt;thymeleaf-demo&lt;/artifactId&gt;
      &lt;version&gt;1.0.0&lt;/version&gt;
      &lt;name&gt;thymeleaf-demo&lt;/name&gt;
      &lt;description&gt;Demo project for Event Sharing&lt;/description&gt;
  
      &lt;properties&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;thymeleaf-spring5.version&gt;3.0.9.RELEASE&lt;/thymeleaf-spring5.version&gt;
          &lt;thymeleaf-layout-dialect.version&gt;2.2.0&lt;/thymeleaf-layout-dialect.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  
  </code></pre>
  
  <p>Here is my controller:</p>
  
  <pre class="lang-java prettyprint-override"><code>@RestController
  @RequestMapping("/users")
  public class UserController {
      @Autowired
      private UserRepository userRepository;
      @GetMapping
      public ModelAndView list(Model model) {
          model.addAttribute("userList", userRepository.listUsers());
          model.addAttribute("title", "List users");
          return new ModelAndView("users/list", "userModel", model);
      }
  }
  
  </code></pre>
  
  <p>Here is my html page list.html:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns:th="http://www.thymeleaf.org"
        xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Thymeleaf Demo!&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div th:replace="~{fragment/header :: header}"&gt;&lt;/div&gt;
  &lt;div th:replace="~{fragment/footer :: footer}"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my project structure:<br>
  <a href="https://i.stack.imgur.com/g5phh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g5phh.png" alt="Project Strucuture"></a></p>
  
  <p>Can anyone help with this exception?</p>