-1
I am developing an application with Spring Boot and Thymeleaf and while trying to generate the . jar that must be run on the server, it even generates everything right, but an error occurs when trying to access the page that is on /resouces/templates/admin/home.html
.
The problem is that by running the method main
to move up the application in my IDE, it works fine, ie, returns me the htmls pages with Thymeleaf and cool funnel, but when I Gero the . jar with the mvn returns me the following exception:
org.thymeleaf.exceptions.Templateinputexception: Error resolving template "/admin/home", template Might not exist or Might not be accessible by any of the configured Template Resolvers
My pom.xml has this information:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
-->
<!-- Conexão com o Postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.3-1100-jdbc41</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
I believe the problem is where your templates are. You put them on src/main/Resources/templates?
– Fábio Zoz
Which command you executed to generate the jar?
– Leonardo Villela