Search code examples
javaspringspring-bootthymeleaf

Spring boot 2.0.3 thymeleaf Error Rendering some pages


I recently upgrade spring boot to the version 2.0.3 and some templates started to fail, I Got this error:

An error happened during template parsing (template: "class path resource [templates/mypage.html]") 
Caused by: org.attoparser.ParseException: null
Caused by: java.util.ConcurrentModificationException: null

Anybody's faced this issue?


Solution

  • The problem was the way the html was rendering a list for a select component, it had a select inside a th:each like this:

    <div th:each="lsPassengers, ***stat*** : *{lsPassengers}">
        <select class="e1 populate w-240 tPassengers" name="tPassengers">
    
        <option th:each="i, ***statPax***: ${session.travelPartner}" 
                                ...
                            </select>
    </div>
    

    In previous version the variable stat was being used in the loop of the select (dont know why) but it was working before, I changed the reused variable for the another (statPax) and then it started to work again

    Hope this helps to someone else!