Ganesh Krishnan Ganesh Krishnan - 1 year ago 165
AngularJS Question

Spring boot with Thymeleaf 3 Beta

Spring boot does not seem to play well with Thymeleaf 3 beta.

java.lang.IllegalStateException: Could not evaluate condition on due to internal class not found.

This can happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)


Caused by: java.lang.NoClassDefFoundError: org/thymeleaf/resourceresolver/IResourceResolver

Any ideas on how I can make it work?

Essentially, I have prebuilt HTML templates which do not really conform to XHTML standards and I want to use this with Thymeleaf. Thymeleaf 2 does not support HTML and even the LEGACYHTML5 mode throws up errors due to angular markup

So, I am stuck with Spring Boot which only uses Thyme2 and no support for Thyme3 but my app would only work with Thyme3

Answer Source

Update: as of 1.4, Spring Boot support Thymeleaf 3 but version 2 remains the default. See the documentation for details on how to use Thymeleaf 3.

Spring Boot 1.3 and earlier don't support Thymeleaf 3. You'll need to disable Boot's auto-configuration for Thymeleaf and configure it manually. You can disable an auto-configuration by using the exclude attribute on @SpringBootApplication: