Open djdenv opened 9 years ago
Can you provide some way for me to reproduce this issue?
actually, I think it does have something to do with the profiler.
Create a new project and add the two plugins: compile ":flash-helper:0.9.9" compile ":profiler:0.5"
Create a controller: def index() { flashHelper.info "test message" }
Modify view: <flashMsg:msg key="info" sep=""/>
Run app to that view and you'll see the error I posted above. I don't know much about writing grails plugins so not sure if a fix would be in this project or profiler.
2015-01-11 22:16:13,738 [http-bio-8080-exec-9] ERROR errors.GrailsExceptionResolver - MissingPropertyException occurred when processing request: [GET] /testflash/test No such property: flashHelperInstance for class: testflash.TestController. Stacktrace follows: Message: No such property: flashHelperInstance for class: testflash.TestController Line | Method ->> 177 | doCall in ProfilerGrailsPlugin$_processController_closure4
| 101 | doCall in FlashHelperGrailsPlugin$_addFlashHelperMethod_closure7 | 180 | doCall . . . . . in ProfilerGrailsPlugin$_processController_closure4 | 6 | index in testflash.TestController | 198 | doFilter . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter | 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter | 82 | doFilterInternal in com.linkedin.grails.profiler.ProfilerFilter | 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor | 617 | run . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker ^ 745 | run in java.lang.Thread
If you remove the profiler plugin, does the problem still occur?
no. problem does not exist when we remove the profiler plugin.
On that basis, it seems more likely that the problem is with the profiler plugin, so I doubt I'll spend any time investigating this, given that there probably aren't too many apps using both this plugin and the profiler.
I can understand that. I thought maybe it had to do with how the plugin was injected into the controllers. Again, don't know much about plugin development so was hoping for an easy (known) fix. Thanks.
the flashHelper variable does not seem to be injected into Controllers all the time. I especially see this when running through an IDE and the runtime refreshes, but have also seen it when running a simple run-app (outside of IDE). Here is a full stacktrace (note that this occurs with or without the linkedin profiler filter). I am running under grails 2.4.4
No such property: flashHelper for class: com.mycompany.gram.web.GraphicsController. Stacktrace follows: Message: No such property: flashHelper for class: com.mycompany.gram.web.GraphicsController Line | Method ->> 289 | update in com.mycompany.gram.web.GraphicsController
| 198 | doFilter in grails.plugin.cache.web.filter.PageFragmentCachingFilter | 63 | doFilter . . . . in grails.plugin.cache.web.filter.AbstractFilter | 82 | doFilterInternal in com.linkedin.grails.profiler.ProfilerFilter | 1142 | runWorker . . . in java.util.concurrent.ThreadPoolExecutor | 617 | run in java.util.concurrent.ThreadPoolExecutor$Worker ^ 745 | run . . . . . . in java.lang.Thread