Thursday, May 2, 2013

Error Error executing script DbmGormDiff: groovy.lang.MissingMethodException: No signature of method: static grails.plugin.databasemigration.MigrationUtils.dataSourceNameWithSuffix() is applicable for argument types: (null) values: [null] (Use --stacktrace to see the full trace)


I get this error when I using database-migration plugin to generate new changelog file for the changes of domain classes.

$ grails dbm-gorm-diff new-changes-for-domainclass.groovy -add

| Error Error executing script DbmGormDiff: groovy.lang.MissingMethodException: No signature of method: static grails.plugin.databasemigration.MigrationUtils.dataSourceNameWithSuffix() is applicable for argument types: (null) values: [null] (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
groovy.lang.MissingMethodException: No signature of method: static grails.plugin.databasemigration.MigrationUtils.dataSourceNameWithSuffix() is applicable for argument types: (null) values: [null]
at _DatabaseMigrationCommon_groovy$_run_closure1.doCall(_DatabaseMigrationCommon_groovy:37)
at DbmGormDiff$_run_closure1.doCall(DbmGormDiff:34)
| Error Error executing script DbmGormDiff: groovy.lang.MissingMethodException: No signature of method: static grails.plugin.databasemigration.MigrationUtils.dataSourceNameWithSuffix() is applicable for argument types: (null) values: [null]


Solution: 

  1. Check your Grails database-migration plugin version, based on my tests, the latest version 1.3.3 does not work. and please to use version 1.1 instead.
  2. Delete everything in the folder: ~/.grails/yourGrailsVersionNumber//projects/yourProjectName/scriptCache/
  3. Then run $grails dbm-gorm-diff ....


3 comments:

  1. Thanks Sean, this helped perhaps more than you realize. I had the same error after upgrading to 1.3.3, and trying other versions did not help. I found a comment on SO that the issue seems to be with 1.3.2, and I found GGTS plugin manager thought I was at 1.3.2 instead of 1.3.3.

    I followed your instructions to clean out the scriptCache folder, but instead of reverting to 1.1, I tried adding 1.3.3 again, cleaned and restarted and the dbm script worked again.

    I have to ask, did you have other problems with 1.3.3? I ask because dropOnStart is not working in 1.1, but is on 1.3.3, and it's useful for me while testing in a PaaS env. Thanks!

    ReplyDelete
    Replies
    1. Sorry for late reply.

      So far I have only this issue with 1.3.3 and I revert to use 1.1 due to it is sufficient to my project needs.

      You probably can post your problem on the official forum.

      And please update me once you fix your issue.

      Cheers!

      Delete
  2. Thanks it helped.

    ReplyDelete