Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.1.2
    • Fix Version/s: 1.1.2, 1.2-RC1
    • Component/s: None
    • Labels:
      None
    • Patch Submitted:
      Yes

      Description

      The following Grails domain class does not compile (at runtime).

      class Person {
      String name

      String getSomething(int i) {
      }
      }

      I get this error when I run with grails run-app:

      2008-12-27 15:26:33.955::WARN: Failed startup of context org.mortbay.jetty.webapp.WebAppContext@187e184

      {/asrs2,C:\Steve\asrs2/web-app}

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
      at java.security.AccessController.doPrivileged(Native Method)
      at RunApp_groovy$_run_closure2_closure7.doCall(RunApp_groovy:67)
      at RunApp_groovy$_run_closure2_closure7.doCall(RunApp_groovy)
      at Init_groovy$_run_closure6.doCall(Init_groovy:131)
      at RunApp_groovy$_run_closure2.doCall(RunApp_groovy:66)
      at RunApp_groovy$_run_closure2.doCall(RunApp_groovy)
      at RunApp_groovy$_run_closure1.doCall(RunApp_groovy:57)
      at RunApp_groovy$_run_closure1.doCall(RunApp_groovy)
      at gant.Gant.dispatch(Gant.groovy:271)
      at gant.Gant.this$2$dispatch(Gant.groovy)
      at gant.Gant.invokeMethod(Gant.groovy)
      at gant.Gant.processTargets(Gant.groovy:436)
      at gant.Gant.processArgs(Gant.groovy:372)
      Caused by: java.lang.NullPointerException
      at java.lang.Class.isAssignableFrom(Native Method)
      ... 13 more

      If I change the method getSomething to doSomething then it works. Is getSomething(int i) somehow being treated as a bean method?

      See user@grails.codehaus.org message "Grails getSomething(int i) method doesn't comiple" for discussion.

        Activity

        Hide
        John Wright added a comment -

        Here's the DefaultGrailsDomainClass.establishRelationships() method patched to fix the issue, based on Burt Beckwith's suggestion.

        Show
        John Wright added a comment - Here's the DefaultGrailsDomainClass.establishRelationships() method patched to fix the issue, based on Burt Beckwith's suggestion.
        Hide
        Graeme Rocher added a comment -

        Thanks for the patch

        Show
        Graeme Rocher added a comment - Thanks for the patch

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Steve Kuo
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development