You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: @ResponseBody with Map result returns JSON array twice in case of synchronizeOnSession=true [SPR-13983] #18555
Toshimitsu Nakanishi I have tried to reproduce this behavior by creating a fresh new project with start.spring.io, configuring the project to use Spring Framework 4.2.5 with <spring.version>4.2.5.RELEASE</spring.version>, and creating a @Controller with the code you provided, but I see the same correct behavior for both 4.2.4 and 4.2.5.
Could you give me more details (Jackson version used for example) and maybe provide a repro project? You can use spring-framework-issues templates (without Spring Boot) or start.spring.io.
I just tried with Jackson 2.4.2 and can't reproduce the issue. Could you please provide a repro project to help identifying where this strange behavior come from?
When adapter.setSynchronizeOnSession(true); all of Controllers are run 2 times 1 request.
when comment out adapter.setSynchronizeOnSession(true);. all of Controllers are run 1 times while by 1 request.
Sorry but I think a really need a repro project to see what's going on, could you please provide it even as just a zip attached to this issue or as a GitHub repository?
Activity
spring-projects-issues commentedon Feb 26, 2016
Sébastien Deleuze commented
Toshimitsu Nakanishi I have tried to reproduce this behavior by creating a fresh new project with start.spring.io, configuring the project to use Spring Framework 4.2.5 with
<spring.version>4.2.5.RELEASE</spring.version>, and creating a@Controllerwith the code you provided, but I see the same correct behavior for both 4.2.4 and 4.2.5.Could you give me more details (Jackson version used for example) and maybe provide a repro project? You can use spring-framework-issues templates (without Spring Boot) or start.spring.io.
spring-projects-issues commentedon Feb 26, 2016
Toshimitsu Nakanishi commented
my Jackson version is 2.4.2.
project includes jackson-core-2.4.2.jar and jackson-databind-2.4.2.jar.
build by JVM 1.8.74.
with 4.2.5 controller returned response was
{"result":true}{"result":true}
with 4.2.4 controller returned response was only
{"result":true}
spring-projects-issues commentedon Feb 26, 2016
Sébastien Deleuze commented
I just tried with Jackson 2.4.2 and can't reproduce the issue. Could you please provide a repro project to help identifying where this strange behavior come from?
spring-projects-issues commentedon Feb 26, 2016
Toshimitsu Nakanishi commented
When adapter.setSynchronizeOnSession(true); all of Controllers are run 2 times 1 request.
when comment out adapter.setSynchronizeOnSession(true);. all of Controllers are run 1 times while by 1 request.
spring-projects-issues commentedon Feb 26, 2016
Sébastien Deleuze commented
Sorry but I think a really need a repro project to see what's going on, could you please provide it even as just a zip attached to this issue or as a GitHub repository?
spring-projects-issues commentedon Feb 26, 2016
Toshimitsu Nakanishi commented
repro project zip
100% reproduce.
check out project file.
reproduce operation.
access /test1/json/test
-> result was {"result": true}
This is correct.
access /test1/html/test
-> result was test.
this method works controller to jsp.
re-access /test1/json/test
-> result was {"result": true}{"result": true}
controller method was executed 2 times.
but, if comment out adapter.setSynchronizeOnSession(true);
works good.
spring-projects-issues commentedon Feb 26, 2016
Sébastien Deleuze commented
Thanks for your repro project, I confirm it is reproducible with your project + instructions. I will keep you informed of what I find.
spring-projects-issues commentedon Feb 29, 2016
Sébastien Deleuze commented
Likely to be a duplicate of #18572
spring-projects-issues commentedon Feb 29, 2016
Sébastien Deleuze commented
I have added a repo project with repo instructions that:
spring-projects-issues commentedon Feb 29, 2016
Sébastien Deleuze commented
This issue is fixed (validated with the repo project) by #18572 related commits, on latest 4.2.x branch 0349abc565da1523daa84d42d5950ab2ebf12df2 and 8a44560d82b40af65a3b79c3a5c3915ae2e3d5b7.