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

groovy.lang.MissingPropertyException #3

Open
djdenv opened this issue Jan 12, 2015 · 7 comments
Open

groovy.lang.MissingPropertyException #3

djdenv opened this issue Jan 12, 2015 · 7 comments

Comments

@djdenv
Copy link

djdenv commented Jan 12, 2015

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

@ghost
Copy link

ghost commented Jan 12, 2015

Can you provide some way for me to reproduce this issue?

@djdenv
Copy link
Author

djdenv commented Jan 12, 2015

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

@ghost
Copy link

ghost commented Jan 12, 2015

If you remove the profiler plugin, does the problem still occur?

@djdenv
Copy link
Author

djdenv commented Jan 12, 2015

no. problem does not exist when we remove the profiler plugin.

@ghost
Copy link

ghost commented Jan 12, 2015

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.

@djdenv
Copy link
Author

djdenv commented Jan 12, 2015

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.

@ghost
Copy link

ghost commented Jan 12, 2015

The way that the flashHelper property is injected into controllers is pretty standard, so there's no obvious/easy fix that springs to mind. If you want to investigate yourself, the relevant code is the addFlashHelperMethod in this file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant