sheehan / grails-console

A web-based Groovy console for interactive runtime application management and debugging
Apache License 2.0
78 stars 41 forks source link

Console 1.5.5 fails to run in prod mode war in Grails 2.5.1 & Java 8u51 #38

Closed rgoldberg closed 3 years ago

rgoldberg commented 9 years ago

The Console 1.5.5 fails to run in prod mode war in Grails 2.5.1 & Java 8u51.

I get the error at the end of this post.

When I reverted to 1.5.4, it worked.

1.5.4 doesn't have _favicon.gsp, or reference it using <g:render template="favicon" />.

ERROR StackTrace  - Full Stack Trace:
org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Template not found for name [favicon] and path [/console/_favicon.gsp]
    at home_tomcat_apache_tomcat_7_0_59_webapps_ROOT_WEB_INF_plugins_console_1_5_5_grails_app_views_console_index_gsp$_run_closure1.doCall(home_tomcat_apache_tomcat_7_0_59_webapps_ROOT_WEB_INF_plugins_console_1_5_5_grails_app_views_console_index_gsp:27)
    at home_tomcat_apache_tomcat_7_0_59_webapps_ROOT_WEB_INF_plugins_console_1_5_5_grails_app_views_console_index_gsp.run(home_tomcat_apache_tomcat_7_0_59_webapps_ROOT_WEB_INF_plugins_console_1_5_5_grails_app_views_console_index_gsp:34)
    at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
    at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
    at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)
    at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
    at grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:53)
    at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62)
    at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
ERROR StackTrace  - Full Stack Trace:
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Template not found for name [favicon] and path [/console/_favicon.gsp]
    at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
    at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
    at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)
    at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
    at grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:53)
    at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62)
    at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Template not found for name [favicon] and path [/console/_favicon.gsp]
    at home_tomcat_apache_tomcat_7_0_59_webapps_ROOT_WEB_INF_plugins_console_1_5_5_grails_app_views_console_index_gsp$_run_closure1.doCall(home_tomcat_apache_tomcat_7_0_59_webapps_ROOT_WEB_INF_plugins_console_1_5_5_grails_app_views_console_index_gsp:27)
    at home_tomcat_apache_tomcat_7_0_59_webapps_ROOT_WEB_INF_plugins_console_1_5_5_grails_app_views_console_index_gsp.run(home_tomcat_apache_tomcat_7_0_59_webapps_ROOT_WEB_INF_plugins_console_1_5_5_grails_app_views_console_index_gsp:34)
    ... 16 more
sheehan commented 9 years ago

strange... i just tested it with grails 2.5.1 / java 8 / tomcat and it works for me. Does the _favicon.gsp exist in your war file?

rgoldberg commented 9 years ago

The file is located in the war at:

/WEB-INF/plugins/console-1.5.5/grails-app/views/console/_favicon.gsp

I debugged, and the Grails code was looking for the file at:

/WEB-INF/grails-app/views/console/_favicon.gsp

The pluginName variable in the code was either the empty String, or null, I forget which.

I assume that if the plugin name weren't empty or null, then the Grails code would have found it.

I'm running Tomcat 7.0.59 on Ubuntu 14.04.2 LTS. I'm using Asset Pipeline 2.4.3 & Resources 1.2.14.

I don't know if there's anything else that might affect the operation of the Console plugin.

rgoldberg commented 9 years ago

I think I figured out what causes the error:

The app that I'm working on has the following line in its Config.groovy:

grails.gsp.enable.reload = true

When I remove that line, Console 1.5.5 works without the error; if I add it, it fails.

I assume that the setting allows GSPs to be reloaded without restarting the server, but I don't know for sure.

I don't why the app I'm working on has it for both prod & dev (the app was started two years or so before I started working on it, so the setting was inherited).

I will ask if I can remove this property entirely, or at least only have it in dev.

Is it intended that this setting cause the error? If so, can someone somehow output a more informative error message? I assume that this is in Grails core code, not Console plugin code, so it might be hard to output a better error message, unless this setting will mess up all plugins, not just Console.

Or is there a bug in Console 1.5.5?

Or is there a bug in Grails, or elsewhere (like Resources, or Asset Pipeline, etc.)?

sheehan commented 9 years ago

I assume that the setting allows GSPs to be reloaded without restarting the server, but I don't know for sure.

That looks to be the case: http://grails.github.io/grails-doc/2.5.0/guide/theWebLayer.html#makingChangesToADeployedApplication

I'm not sure why that would change the behavior of loading templates though. Do you also have grails.gsp.view.dir defined?

imathew commented 8 years ago

I've had the same issue, and the project did have grails.gsp.enable.reload set to true, but disabling didn't make a difference.

This is an old, large project on Grails 2.2.4 and the problem is probably its codebase, not the plugin, and I don't have time to debug so I've just limited the upgrade to 1.5.4. Good enough for me!

luizcantoni commented 3 years ago

I've had this issue and my solution was update from version 1.5.7 to 1.5.12.