Open mklinkj opened 1 year ago
Hey there, sorry to take so long getting back to you on this one as this is an interesting bug and had me stumped for a very long time. However, I gave it another look this weekend and found the issue.
The Gretty plugin is written against Groovy 3, and introduces Groovy 3 JARs into the classloader of the servlet container that is being launched (Tomcat 10 in this case). However, version 3.1.0 and newer of the Thymeleaf Layout Dialect is written in Groovy 4, and so this mixup of Groovy versions causes the issues that you're seeing.
The only workarounds I can think of right now are:
I hope that gives you some options to consider. Thank you again for the bug report and the example project which helped me figure out what was going on 🙇♂️
Thanks for your answer.
I posted the question in two places, so there’s also an issue on Gretty’s Github. 😅
https://github.com/gretty-gradle-plugin/gretty/issues/289
Have a nice day. 👍
Hello.
When running the web server with Gretty.. When accessing the layout page, the following exception is exposed and nothing appears on the web browser screen.
Exception Log
My project environment looks like this
3.1.1.RELEASE
3.2.1
4.0.3
10.1.10
When I run the web project, I run it with the command below.
When I ran Gretty and accessed the page with the layout applied, I definitely saw the aforementioned exception.
However, there are two things that are unusual.
✨ Two unusual things
If I'm using a direct deployment of Tomcat without using Gretty, I don't get the exception.
If I use
https://github.com/zhanhb/thymeleaf-layout-dialect
, there's no problem running a web project with Gretty.✨ Example project to see the problem
I've created an example project for you to see the issue.
Example project github url
Example project Zip File
How to run
Accessing the layout page in a web browser
http://localhost:8090/main
Thank you. Have a nice day. 👍