Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.4-M1
-
Fix Version/s: 2.0-M1
-
Component/s: View technologies
-
Labels:None
-
Environment:Windows 7 - 64bit, Java 6 - 64 bit, Grails 1.4.0-M1, STS 2.7.0M1
Description
I have a screen with 6 PNG images on it (charts)... think of a a graphical dashboard. Now that I upgraded to 1.4.0M1 these images come up very inconsistently. If I refresh these PNG's sometimes appear in the wrong spot (ie. chart 4 will appear 3 times over other charts, in the wrong order...etc). Every time I refresh it seems to change the behavior of where the charts are appearing.
This is how I create the charts using JfreeChart:
EncoderUtil.writeBufferedImage(chart.createBufferedImage(400, 100), "png", response.getOutputStream())
This is how they are displayed:
<img width='400' height='100' src='$
?r=$
{System.currentTimeMillis()}' />
This worked perfectly in all previous version
-
- Firefox and IE.docx
- 29/May/11 12:15 PM
- 490 kB
- Henry Zaccak
-
Hide
- Test.zip
- 29/May/11 12:07 PM
- 2.27 MB
- Henry Zaccak
-
- Test/.classpath 4 kB
- Test/.project 0.9 kB
- Test/.../com.springsource.sts.grails.core.prefs 0.2 kB
- Test/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- Test/.../org.eclipse.wst.common.project.facet.core.xml 0.1 kB
- Test/application.properties 0.1 kB
- Test/grails-app/conf/BootStrap.groovy 0.1 kB
- Test/grails-app/conf/BuildConfig.groovy 1 kB
- Test/grails-app/conf/Config.groovy 4 kB
- Test/grails-app/conf/DataSource.groovy 0.7 kB
- Test/grails-app/.../spring/resources.groovy 0.0 kB
- Test/grails-app/conf/UrlMappings.groovy 0.2 kB
- Test/grails-app/.../TestController.groovy 5 kB
- Test/grails-app/i18n/messages.properties 3 kB
- Test/grails-app/.../messages_da.properties 3 kB
- Test/grails-app/.../messages_de.properties 4 kB
- Test/grails-app/.../messages_es.properties 3 kB
- Test/grails-app/.../messages_fr.properties 2 kB
- Test/grails-app/.../messages_it.properties 2 kB
- Test/grails-app/.../messages_ja.properties 2 kB
- Test/grails-app/.../messages_nl.properties 3 kB
- Test/.../messages_pt_BR.properties 3 kB
- Test/.../messages_pt_PT.properties 3 kB
- Test/grails-app/.../messages_ru.properties 4 kB
- Test/grails-app/.../messages_sv.properties 3 kB
- Test/grails-app/.../messages_th.properties 5 kB
- Test/.../messages_zh_CN.properties 2 kB
- Test/grails-app/views/error.gsp 2 kB
- Test/grails-app/views/index.gsp 2 kB
- Test/grails-app/views/layouts/main.gsp 2 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Here is an STS project. Start up the app and go to the index page. Refresh it a few times and you will see chart1 shows up in chart2's spot.. etc. The charts just move around in different spots. Keep refreshing the screen and every now and then it will happen.
You can see it here in my screenshots. It seems to happen more in firefox, but it does happen in IE as well. It's less noticeable when I take out the ?r=$
{System.currentTimeMillis()}but it still happens without a constant behavior.
This must be a bug in Grails. I tried the test app and added some logging to the different methods. On the browser side I could see separate requests for chart1, chart2, chart3, chart4, chart5 & chart6, but on the server side random chart* actions get executed.
In Test.zip's TestController, I added a println to each action.
to chart1:
println "chart1 $
to chart2:
println "chart2 ${webRequest.actionName}
"
.
.
.
This prints out:
chart5 chart5
chart5 chart6
chart5 chart3
chart5 chart1
chart5 chart2
chart5 chart4
The webRequest.actionName is correct, but the request gets routed to the wrong action .
Problem in grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/ControllersGrailsPlugin.groovy , the mainSimpleController isn't a prototype bean.
Hi Lari, Is there a quick workaround I can use until M2 comes out?
You could redefine the 'mainSimpleController' bean as prototype in resources.groovy
mainSimpleController(SimpleGrailsController) { bean ->
grailsControllerHelper = ref('grailsControllerHelper')
bean.scope = 'prototype'
}
attach an example that reproduces the problem