Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grails upgrading 2.4.0 causes Error Compilation error: startup failed

Tags:

grails

upgrade

I am trying to upgrade from Grails 2.2.3 to Grails 2.4.0. For that I have followed following steps:

  1. using GVM, I have installed grails 2.4.0
  2. set grails default version to 2.4.0
  3. then run command to set-grails-version to 2.4.0 in my project directory and then updated java to use oracle jdk 7

I am getting the following error. Any suggestion why?

Error Compilation error: startup failed:
/home/madan/.grails/2.4.0/projects/mainthub/plugins/mail-1.0/src/groovy/grails/plugin/mail/MailMessageContentRenderer.groovy: 21: unable to resolve class org.codehaus.groovy.grails.plugins.PluginManagerHolder
 @ line 21, column 1.
   import org.codehaus.groovy.grails.plugins.PluginManagerHolder
   ^

/home/madan/.grails/2.4.0/projects/mainthub/plugins/resources-1.2/grails-app/taglib/org/grails/plugin/resource/ResourceTagLib.groovy: 6: unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder
 @ line 6, column 1.
   import org.codehaus.groovy.grails.commons.ConfigurationHolder
   ^

/home/madan/.grails/2.4.0/projects/mainthub/plugins/resources-1.2/src/groovy/org/grails/plugin/resource/ResourceProcessor.groovy: 6: unable to resolve class org.codehaus.groovy.grails.plugins.PluginManagerHolder
 @ line 6, column 1.
   import org.codehaus.groovy.grails.plugins.PluginManagerHolder
   ^

/home/madan/.grails/2.4.0/projects/mainthub/plugins/resources-1.2/src/groovy/org/grails/plugin/resource/util/HalfBakedLegacyLinkGenerator.groovy: 3: unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder
 @ line 3, column 1.
   import org.codehaus.groovy.grails.commons.ConfigurationHolder
   ^

/home/madan/.grails/2.4.0/projects/mainthub/plugins/joda-time-1.4/grails-app/taglib/grails/plugin/jodatime/taglib/PeriodTagLib.groovy: 18: unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder
 @ line 18, column 1.
   import org.codehaus.groovy.grails.commons.ConfigurationHolder
   ^

/home/madan/.grails/2.4.0/projects/mainthub/plugins/email-confirmation-2.0.8/grails-app/services/com/grailsrocks/emailconfirmation/EmailConfirmationService.groovy: 24: unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder
 @ line 24, column 1.
   import org.codehaus.groovy.grails.commons.ConfigurationHolder
   ^

/home/madan/.grails/2.4.0/projects/mainthub/plugins/email-confirmation-2.0.8/grails-app/services/com/grailsrocks/emailconfirmation/EmailConfirmationService.groovy: 25: unable to resolve class org.codehaus.groovy.grails.commons.ApplicationHolder
 @ line 25, column 1.
   import org.codehaus.groovy.grails.commons.ApplicationHolder
   ^

/home/madan/.grails/2.4.0/projects/mainthub/plugins/quartz-1.0-RC2/grails-app/conf/QuartzBootStrap.groovy: 18: unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder
 @ line 18, column 1.
   import org.codehaus.groovy.grails.commons.ConfigurationHolder
   ^

/home/madan/.grails/2.4.0/projects/mainthub/plugins/quartz-1.0-RC2/grails-app/conf/QuartzBootStrap.groovy: 31: unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder 
 @ line 31, column 12.
           if(ConfigurationHolder.config?.quartz?.autoStartup) quartzScheduler.start()
              ^

/home/madan/.grails/2.4.0/projects/mainthub/plugins/joda-time-1.4/src/groovy/grails/plugin/jodatime/binding/DateTimeEditor.groovy: 20: unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder
 @ line 20, column 1.
   import org.codehaus.groovy.grails.commons.ConfigurationHolder
   ^

/home/madan/.grails/2.4.0/projects/mainthub/plugins/joda-time-1.4/src/groovy/grails/plugin/jodatime/binding/DateTimeEditor.groovy: 30: unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder 
 @ line 30, column 38.
    @Lazy private ConfigObject config = ConfigurationHolder.config?.jodatime?.format
                                        ^

11 errors
like image 986
Madan Sen Avatar asked May 28 '14 15:05

Madan Sen


3 Answers

The holder classes have been removed from Grails 2.4.0. Updating to the latest plugin versions should resolve the compilation errors above.

If you find that the most recent plugin versions don't support Grails 2.4.0, then you'll just have to wait until they release a version that is 2.4.0 compatible before you can upgrade.

From personal experience, I know that the following plugins have 2.4.0 compatible versions:

  • resources
  • mail
  • quartz

But I'm not sure about email-confirmation or joda-time

like image 175
Dónal Avatar answered Nov 16 '22 19:11

Dónal


The following deprecated classes have been removed from Grails 2.4.x:

org.codehaus.groovy.grails.commons.ApplicationHolder
org.codehaus.groovy.grails.commons.ConfigurationHolder
org.codehaus.groovy.grails.plugins.PluginManagerHolder
org.codehaus.groovy.grails.web.context.ServletContextHolder
org.codehaus.groovy.grails.compiler.support.GrailsResourceLoaderHolder

If you or any plugins you have installed are using these classes you will get a compilation error. The problem can be rectified by updating to new plugins and using grails.util.Holders instead.

For example

application = org.codehaus.groovy.grails.commons.ApplicationHolder.application 

to

application = Holders.grailsApplication
like image 30
Vasyl Shyrochuk Avatar answered Nov 16 '22 18:11

Vasyl Shyrochuk


I think ":quartz:1.0.1" and ":resources:1.2.8" are 2.4 compatible. As far as I know the other plugins you are having trouble with do not have 2.4 compatible releases yet. 2.4 has not been out very long and plugin authors are still working to update their code.

like image 3
Jeff Scott Brown Avatar answered Nov 16 '22 17:11

Jeff Scott Brown