Closed ccortes66 closed 11 months ago
Hi, can you share a sample project, that demonstrates the problem?
The error occurs when I generate the JAR in Maven. It compiles successfully, but when it's compiled and put into production, the pages generated in JTE don't appear. Instead, I get a 404 error. This is without considering Spring Security. I tried recompiling the project after removing all Spring Security-related parts, but the error persisted. I have shared the project on GitHub. I was using Spring MVC with JTE.
https://github.com/ccortes66/G5_alura_one_hotel_alura_spring_mvc
I tried compiling and starting your application, but it failed with missing data source in flyway migration. I'm not a spring boot user, so I stopped debugging there :-)
Are the precompiled jte-classes located next to your application jar?
What exception was logged by your application?
hi That GitHub repository uses Flyway for performing migrations in the MariaDB database. In this branch, the project has been modified by removing certain parts. To view the project, it uses SQLite as the database
https://github.com/ccortes66/G5_alura_one_hotel_alura_spring_mvc/tree/sqlite_version
Sorry, that is not helpful. I won't try to debug your application. I just ran it once more and got an infinite redirect, when visiting localhost:8080 Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
Please provide a stacktrace of the exception you are experiencing.
Following thread #280 was very helpful. I created a new production profile in Spring Boot with the following characteristics:
profile application-prod.yml
gg:
jte:
developmentMode: false
usePrecompiledTemplates: true
pom.xml
<build>
<plugins>
<plugin>
<groupId>org.hibernate.orm.tooling</groupId>
<artifactId>hibernate-enhance-maven-plugin</artifactId>
<version>${hibernate.version}</version>
<executions>
<execution>
<id>enhance</id>
<goals>
<goal>enhance</goal>
</goals>
<configuration>
<enableLazyInitialization>true</enableLazyInitialization>
<enableDirtyTracking>true</enableDirtyTracking>
<enableAssociationManagement>true</enableAssociationManagement>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>gg.jte</groupId>
<artifactId>jte-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<sourceDirectory>src/main/jte</sourceDirectory>
<contentType>Html</contentType>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Muchas Gracias,me salvo de usar thymeleaf
Hello, how are you? Following the documentation and the examples presented on GitHub, the precompiled templates are not rendering. When generating the JAR, it looks for the path and throws a 404 Not Found error.