2009年4月17日金曜日

[Grails]Grails Upgrade Steps from 1.0.x to 1.1

Grails Upgrade Steps from 1.0.x to 1.1
  • References
  • Upgrade Steps
    • Backup all application files
    • Add following statements into the grails-app/conf/Config.groovy file
         //upgrade
      grails.views.enable.jsessionid=false
      //grails.project.plugins.dir="./plugins"
    • Create a file grails-app/conf/BuildConfig.groovy file if this file doesn't exist and add following statements into this file.
       //upgrade
      //grails.views.enable.jsessionid=false
      grails.project.plugins.dir="./plugins"
    • if you use some plugins, you need to re-install plugins.
      Remove all plugins files and cleanup files stored under plugins directory
         mv plugins/* /tmp/
    • Run the upgrade command as follows
      (After running this commands, grails will create a new plugin named hibernate-1.1 under the plugins directory automatically. we don't need to re-install this hibernate-1.1 plugin.)
      grails upgrade
    • re-install plugins by using "grails install-plugins" command
      (for example)
      grails install-plugin /tmp/grails-quartz-0.3.1.zip
  • TroubleShooting
  • Plugins TroubleShooting
    • quartz-0.3.1 plugin
      • Error Description
        After starting the grails application, following error appears while starting up the quartz plugin
      • Error Stack
        2009-04-14 16:12:39,907 [main] ERROR context.ContextLoader  - Context initialization failed
        org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingPropertyException: No such property: startDelay for class: QuartzGrailsPlugin
        at org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:74)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
      • Cause
        This error raises from following statements of the configureJobBeans closure in the QuartzGrailsPlugin.groovy file because of the "this" clause.
              // registering triggers
        jobClass.triggers.each {name, trigger ->
        "${name}Trigger"(trigger.clazz) {
        jobDetail = ref("${fullName}JobDetail")
        trigger.properties.findAll {it.key != 'clazz'}.each {
        this["${it.key}"] = it.value /* here */
        }
        }
        }
      • Resolution
        I changed this clause from "this" to "delegate", quartz plugin works fine.

0 件のコメント: