I am trying to upgrade from Grails 2.2.3 to Grails 2.4.0. For that I have followed following steps:
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
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:
But I'm not sure about email-confirmation or joda-time
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With