Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThymeleafReactiveView in conjunction with RouterFunction render fails with UnsupportedOperationException [SPR-17434] #21967

Closed
spring-projects-issues opened this issue Oct 25, 2018 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 25, 2018

Leonard Brünings opened SPR-17434 and commented

The problem is that org.springframework.web.reactive.function.server.DefaultRenderingResponseBuilder.DefaultRenderingResponse#DefaultRenderingResponse wraps the model in an unmodifiableMap and when org.thymeleaf.spring5.view.reactive.ThymeleafReactiveView#render tries to add something to the model it fails with an UnsupportedOperationException.

If the assumption that the model should be mutable is false, then this would be a bug in Thymeleaf instead.

java.lang.UnsupportedOperationException: null
	at java.util.Collections$UnmodifiableMap.put(Collections.java:1457) ~[na:1.8.0_181]
	at org.thymeleaf.spring5.view.reactive.ThymeleafReactiveView.render(ThymeleafReactiveView.java:361) ~[thymeleaf-spring5-3.0.10.RELEASE.jar:3.0.10.RELEASE]
	at org.springframework.web.reactive.function.server.DefaultRenderingResponseBuilder$DefaultRenderingResponse.lambda$writeToInternal$2(DefaultRenderingResponseBuilder.java:201) ~[spring-webflux-5.0.10.RELEASE.jar:5.0.10.RELEASE]

See attached fail-demo.zip to replicate this behavior.


Affects: 5.0.10

Attachments:

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 25, 2018

Juergen Hoeller commented

This looks like a duplicate of #21940 which is marked as invalid on our end since it is about to be fixed in Thymeleaf.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 26, 2018

Leonard Brünings commented

Thanks, the respective Thymeleaf issue is thymeleaf/thymeleaf-spring#196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants