Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 org.springframework.boot.autoconfigure.security.FallbackWebSecurityAutoConfiguration 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

like image 868
Ganesh Krishnan Avatar asked Jan 26 '26 10:01

Ganesh Krishnan


1 Answers

This is the correct answer. Here is the class to exclude to make it easier for the next person with this issue:

@SpringBootApplication(exclude={org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration.class})
like image 155
Tim Christensen Avatar answered Jan 28 '26 02:01

Tim Christensen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!