Griffon
  1. Griffon
  2. GRIFFON-282

StackOverflowError when queryin a controller for its metaclass

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.9.1
    • Fix Version/s: 0.9.2-beta-2
    • Component/s: cli
    • Labels:
      None
    • Number of attachments :
      0

      Description

      This error happens when a controller extends a class that does not implement griffon.core.GriffonController. The following code is enough to trigger the error

      // src/main/Base.java
      public class Base {}
      
      // griffon-app/controllers/SampleController.groovy
      class SampleController extends Base {}
      

      Base may be either Java or Groovy, it makes no difference.

        Activity

        Hide
        Vincent Cottet added a comment - - edited

        I found an other way to reproduce the problem :

        I used this controller :

        package test092
        
        import groovy.lang.MetaClass;
        import griffon.core.GriffonClass;
        import griffon.core.ArtifactManager;
        
        class Test092Controller {
            // these will be injected by Griffon
            def model
            def view
        
            public MetaClass getMetaClass() {
                //Test092Controller.getMetaClass() // OK
                getTruc().getMetaClass()
            }
        
            public String getTruc() { 'toutouyoutou' }
        
        }
        

        And then, launched the app disabling injection.

        So, the problem seems to be the call to getGriffonClass() in the injected getMetaClass()

        Show
        Vincent Cottet added a comment - - edited I found an other way to reproduce the problem : I used this controller : package test092 import groovy.lang.MetaClass; import griffon.core.GriffonClass; import griffon.core.ArtifactManager; class Test092Controller { // these will be injected by Griffon def model def view public MetaClass getMetaClass() { //Test092Controller.getMetaClass() // OK getTruc().getMetaClass() } public String getTruc() { 'toutouyoutou' } } And then, launched the app disabling injection. So, the problem seems to be the call to getGriffonClass() in the injected getMetaClass()

          People

          • Assignee:
            Andres Almiray
            Reporter:
            Andres Almiray
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: