Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception occurs when using Gretty and Thymeleaf Layout Dialect together. #289

Open
mklinkj opened this issue Aug 7, 2023 · 1 comment

Comments

@mklinkj
Copy link

mklinkj commented Aug 7, 2023

Hello.

After running the web server with Gretty and accessing the layout page, the following exception is exposed and nothing is displayed on the web browser screen.

  • Exception Log

    ...
    Caused by: groovy.lang.MissingMethodException: No signature of method: org.thymeleaf.engine.Model.first() is applicable for argument types: () values: []
    Possible solutions: print(java.io.PrintWriter), print(java.lang.Object), find(), find(groovy.lang.Closure), is(java.lang.Object), write(java.io.Writer)
    ...
    

My project environment looks like this:

  • Spring 6 (Not Spring Boot): 6.0.11
  • Thymeleaf
    • thymeleaf-spring6: 3.1.2.RELEASE
    • thymeleaf-layout-dialect: 3.2.1
  • Gretty: 4.1.0
    • Tomcat: 10.1.11
  • Gradle: 8.2.1
  • Java: 17

When I run the web project, I run it with the command below.

gradle clean appRun

I ran Gretty and accessed the page with the layout applied, and I definitely got the exception mentioned above.

However, when I deploy and run it directly into Tomcat without using Gretty, I get no errors. I'm not sure why.

✨ Example project to see the problem

I created an example project for you to check the problem.

Have a nice day. 👍

@boris-petrov
Copy link
Member

Thanks for the great reproduction and write-up!

What I see is that this first method doesn't generally exist on IModel/Model - here. It is defined in an extension in the other library here. And there is a Groovy extension module defined here. I guess Gretty doesn't read it for some reason or doesn't pass it on the classpath.

@f4lco any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants