Grails
  1. Grails
  2. GRAILS-9002

grailsApplication injection does not work for controller base class in some cases

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.2, 2.0.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      grailsApplication is not injected into controller base class in some cases.

      Test application is attached, just run with "grails dev run-app" and then try http://localhost:8080/grailsapp-inject-test/test

      Removing for example BaseController.c1 or BaseController.m1 or BaseController.m2 makes injection work.
      Removing TestInjectionController.s1 or TestInjectionController.test1 also makes injection work.
      Also adding @Autowired to def grailsApplication helps.

      When testing please make sure to run "grails clean" after each source code modification and running application.

        Activity

          People

          • Assignee:
            Jeff Scott Brown
            Reporter:
            Timur Yusupov
          • Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development