Spring-boot: Upgrade to Thymeleaf 3.0.8

Created on 17 Sep 2017  路  6Comments  路  Source: spring-projects/spring-boot

Thymeleaf-Spring5 3.0.7.RC1 is broken due to Spring Framework 5.0.0.RC4 moving RequestPath into org.springframework.http.server (stack trace 1 below).

However, Thymeleaf-Spring5 3.0.8-SNAPSHOT is broken due to Spring Framework 5.0.0.RC4 moving encodeUrl out of ServerHttpResponse (stack trace 2 below).

With Boot 2.0.0.M4, Thymeleaf is unusable for Spring WebFlux. (Not sure about Spring MVC).

Thymeleaf 3.0.7.RC1 stacktrack

java.lang.NoSuchMethodError: org.springframework.http.server.reactive.ServerHttpRequest.getPath()Lorg/springframework/http/server/reactive/RequestPath;
    at org.thymeleaf.spring5.linkbuilder.webflux.SpringWebFluxLinkBuilder.computeContextPath(SpringWebFluxLinkBuilder.java:91) ~[thymeleaf-spring5-3.0.7.RC1.jar:3.0.7.RC1]
    at org.thymeleaf.linkbuilder.StandardLinkBuilder.buildLink(StandardLinkBuilder.java:126) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.context.AbstractEngineContext.buildLink(AbstractEngineContext.java:167) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.expression.LinkExpression.executeLinkExpression(LinkExpression.java:283) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:84) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.expression.Expression.execute(Expression.java:109) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.expression.Expression.execute(Expression.java:138) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.expression.Expression.execute(Expression.java:125) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.processor.AbstractStandardExpressionAttributeTagProcessor.doProcess(AbstractStandardExpressionAttributeTagProcessor.java:82) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:74) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement(ProcessorTemplateHandler.java:1314) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.OpenElementTag.beHandled(OpenElementTag.java:205) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.Model.process(Model.java:282) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.Model.process(Model.java:290) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.IteratedGatheringModelProcessable.processIterationModel(IteratedGatheringModelProcessable.java:367) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.IteratedGatheringModelProcessable.process(IteratedGatheringModelProcessable.java:221) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.ProcessorTemplateHandler.handleCloseElement(ProcessorTemplateHandler.java:1640) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleCloseElementEnd(TemplateHandlerAdapterMarkupHandler.java:388) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleCloseElementEnd(InlinedOutputExpressionMarkupHandler.java:322) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleCloseElementEnd(OutputExpressionInlinePreProcessorHandler.java:220) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleCloseElementEnd(InlinedOutputExpressionMarkupHandler.java:164) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]

Thymeleaf 3.0.8-SNAPSHOT stack trace

java.lang.NoSuchMethodError: org.springframework.http.server.reactive.ServerHttpResponse.encodeUrl(Ljava/lang/String;)Ljava/lang/String;
    at org.thymeleaf.spring5.linkbuilder.webflux.SpringWebFluxLinkBuilder.processLink(SpringWebFluxLinkBuilder.java:116) ~[thymeleaf-spring5-3.0.8-SNAPSHOT.jar:3.0.8-SNAPSHOT]
    at org.thymeleaf.linkbuilder.StandardLinkBuilder.buildLink(StandardLinkBuilder.java:138) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.context.AbstractEngineContext.buildLink(AbstractEngineContext.java:167) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.expression.LinkExpression.executeLinkExpression(LinkExpression.java:283) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:84) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.expression.Expression.execute(Expression.java:109) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.expression.Expression.execute(Expression.java:138) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.expression.Expression.execute(Expression.java:125) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.processor.AbstractStandardExpressionAttributeTagProcessor.doProcess(AbstractStandardExpressionAttributeTagProcessor.java:82) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:74) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement(ProcessorTemplateHandler.java:1314) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.OpenElementTag.beHandled(OpenElementTag.java:205) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.Model.process(Model.java:282) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.Model.process(Model.java:290) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.IteratedGatheringModelProcessable.processIterationModel(IteratedGatheringModelProcessable.java:367) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.IteratedGatheringModelProcessable.process(IteratedGatheringModelProcessable.java:221) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.ProcessorTemplateHandler.handleCloseElement(ProcessorTemplateHandler.java:1640) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleCloseElementEnd(TemplateHandlerAdapterMarkupHandler.java:388) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleCloseElementEnd(InlinedOutputExpressionMarkupHandler.java:322) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleCloseElementEnd(OutputExpressionInlinePreProcessorHandler.java:220) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleCloseElementEnd(InlinedOutputExpressionMarkupHandler.java:164) ~[thymeleaf-3.0.7.RELEASE.jar:3.0.7.RELEASE]
dependency-upgrade

Most helpful comment

Please note that Thymeleaf 3.0.8.RELEASE has been pushed to Maven Central.

Now that Spring 5 is GA, the thymeleaf-spring5 artifacts will have the same version numbers as the core (3.0.8.RELEASE). So the thymeleaf-spring5.version property in Spring Boot's BOM is probably not needed anymore.

All 6 comments

Thanks, but Thymeleaf has its own tracker so please report that there

No grounds for crafting an integration test with Thymeleaf to avoid this in the future?

For traceability, this issue was resolved in 3.0.8-snapshot in https://github.com/thymeleaf/thymeleaf-spring/commit/1ed59e8c06349bee73bc3d676c526d8d26e7fa10

Apparently a magic process scans Maven Central and repo.spring.io, opens issues, changes spring-boot-dependencies/pom.xml, and commits stuff, so this will be resolved automatically (via another issue) when 3.0.8 is released.

Please note that Thymeleaf 3.0.8.RELEASE has been pushed to Maven Central.

Now that Spring 5 is GA, the thymeleaf-spring5 artifacts will have the same version numbers as the core (3.0.8.RELEASE). So the thymeleaf-spring5.version property in Spring Boot's BOM is probably not needed anymore.

Thanks very much, @danielfernandez

Was this page helpful?
0 / 5 - 0 ratings