Springjpa and thymeleaf work together, the two classes cascade reference each other, HTML pages use objects, error report, is the bug of thymeleaf?

https://github.com/thymeleaf/.

I use jpa, to cascade the two classes through annotations.
in the html page, when you get the object of any class through the thymeleaf tag, it will appear

.

java.lang.StackOverflowError: null
at sun.reflect.misc.ReflectUtil.checkPackageAccess (ReflectUtil.java:164) ~ [na:1.8.0_151]
at sun.reflect.misc.ReflectUtil.isPackageAccessible (ReflectUtil.java:195) ~ [na:1.8.0_151]
at java.beans.Introspector.getBeanInfo (Introspector.java:164) ~ [na:1.8.0_151]
at org.thymeleaf.util.JavaScriptUtils.printObject (JavaScriptUtils.java:353) ~ [thymeleaf-2.1.6.RELEASE. Jar:2.1.6.RELEASE]
at org.thymeleaf.util.JavaScriptUtils.print (JavaScriptUtils.java:184) ~ [thymeleaf-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.thymeleaf.util.JavaScriptUtils.printKeyValue (JavaScriptUtils.java:346) ~ [thymeleaf-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.thymeleaf.util.JavaScriptUtils.printMap (JavaScriptUtils.java:337) ~ [thymeleaf-2.1.6.RELEASE.jar:2.1.6.RELEASE]

this error, this should be the bug of thymeleaf. Did thymeleaf fix this bug?
my solution now is to use the third-party json jar package jackson to convert the object into json to the foreground, but I need to do it manually, which doesn"t feel good.

is there any other better way


this is the bug of thymeleaf 2. Upgrading to thymeleaf 3 can resolve this bug;

thymeleaf2 is handled by json;
thymeleaf3. The jackson,jackson used by thymeleaf3 can solve the problem of mutual reference between the two classes by using @ JsonIgnoreProperties and @ JsonIgnore annotations.

Menu