0

i am getting 'ScriptExitException' while running this grails app.

the only change in the code is this Domain Class

class Album {

static constraints = {
  String title
  static hasMany = [songs:Song]
} }

console-output:

grails> run-app | Compiling 1 source files. | Error Compilation error: startup failed: APP-FOLDER/grails-app/domain/com/gtunes/Album.groovy: 7: Modifier 'static' not allowed here. @ line 7, column 6. static hasMany = [songs:Song] ^

1 error | Error Error running script run-app: org.codehaus.groovy.grails.cli.ScriptExitException (Use --stacktrace to see the full trace)

I have to keep it static, because it's being used somewhere.. any idea what should fix this?

1 Answer 1

1

re arrange your class like this

class Album {

      String title
      static hasMany = [songs:Song]


      static constraints = {

      } 

}
1
  • Thanks @rami-enbashi. this change in groovy file did make the app run. But it's not functioning as required. will keep it posted here if this was the right fix.
    – soomro
    Jan 16, 2014 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.