I have a demo grails application that can be used to re-create this error. I have a controller name ApplicationController, and corresponding Application domain class.
I can view the list applications web page (no records shown), but I can't add applications.
To recreate this bug, just run rails run-app and click on the Applications link from the home page. Then click on New Application link, you will see the following error
Message: Application cannot be cast to javax.servlet.ServletContext
Caused by: Application cannot be cast to javax.servlet.ServletContext
Class: Unknown
java.lang.ClassCastException: Application cannot be cast to javax.servlet.ServletContext
at WEB_INF_grails_app_views_application_create_jsp.run(WEB_INF_grails_app_views_application_create_jsp:9)
I suspect that I'm using a reserved name for my controller causing a class name conflict. If this is the case, it would be nice to know what tablename/fieldnames we should not be using to avoid this and get an error message that tells us this.
I wouldn't say its critical as changing the controller code would fix the problem