Uploaded image for project: 'Grails'
  1. Grails
  2. GRAILS-9002

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


    • 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:


      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.


        Timur Yusupov created issue -
        Timur Yusupov made changes -
        Field Original Value New Value
        Status Open [ 1 ] Edit [ 10000 ]
        Affects Version/s 2.0.3 [ 13094 ]
        Jeff Scott Brown made changes -
        Assignee Jeff Brown [ brownj ]
        Burt Beckwith made changes -
        Status Edit [ 10000 ] Open [ 1 ]


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


            • Created: