Enonic version: 7.13.1
OS: Enonic Cloud
lib-thymeleaf version: 2.0.1
We are being warned by Enonic Cloud team to upgrade our application to the latest XP version ASAP.
The application is hosted on Enonic Cloud.
Currently we are running on version 7.11.3 but we are experiencing errors when trying to upgrade to 7.13.1
We have many, many, many Thymeleaf expressions using EntrySet interations from a Maps. Previously it was just causing warnings but in the newest Java version they turned into errors.
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public final java.lang.Object java.util.HashMap$Node.getKey() accessible: module java.base does not “opens java.util” to unnamed module ~3ec5552c
One example of Thymeleaf expression is the following:
<div data-th-each="hotelCategory:${tour.hotels}" data-th-remove="tag">
<div data-th-if="${not #lists.isEmpty(tour.hotels[hotelCategory.key])}" data-th-remove="tag">
<h2 data-th-if="${tour.hotels[hotelCategory.key][0].category}" data-th-text="${tour.hotels[hotelCategory.key][0].category}"></h2>
<div data-th-remove="tag" data-th-if="${tour.hotels[hotelCategory.key][0].categoryDescription}" data-th-utext="${tour.hotels[hotelCategory.key][0].categoryDescription}"></div>
</div>
</div>
Every KEY or VALUE access from th:each iterations on Maps cause those reflection/module access error.
Do you have any suggestion other than rewriting our controllers to not use map iteration?
.
PS.: I found one solution online asking me to use the following JVM arguments:
–add-opens java.base/java.lang=ALL-UNNAMED
–add-opens java.base/java.util=ALL-UNNAMED
Is that feasible on Enonic Cloud?