Ed Cardenas
Ed Cardenas

Reputation: 61

How do I fix this: "ClassDefFoundError: org/codehaus/groovy/grails/commons/ConfigurationHolder"?

I was trying to run my grails project which I upgraded to 2.4.4 from 2.3.5. Now after trying to run it, I get these error:

|Running Grails application
context.GrailsContextLoaderListener Error initializing the application: org/codehaus/groovy/grails/commons/ConfigurationHolder
java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/commons/ConfigurationHolder
    at grails.plugin.hibernate3.HibernatePluginSupport$__clinit__closure1.doCall(HibernatePluginSupport.groovy:129)
    at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:754)
    at grails.spring.BeanBuilder.beans(BeanBuilder.java:584)
    at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:527)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.grails.commons.ConfigurationHolder
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    ... 8 more
Error |
Forked Grails VM exited with error

Upvotes: 0

Views: 1789

Answers (2)

user4582135
user4582135

Reputation: 519

If you are using Eclipse, go to Java build path, Order and Export, tick all the libraries and then execute the application

Upvotes: -1

dMcNavish
dMcNavish

Reputation: 637

Based on Grail's migration doc, it looks like they have remove ConfigurationHolder from 2.4.

You need to update the hibernate plugin.

From their doc:

Static Holder Classes 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.

If your application uses the jquery plugin you will need to update to version 1.11.0.2 or later as previous versions of the plugin made use of the ApplicationHolder class. If your application uses the resources plugin you will need to update to version 1.2.7 or later as previous versions of the plugin made use of the ConfigurationHolder class.

migration doc: http://grails.github.io/grails-doc/2.4.x/guide/upgradingFrom23.html

Upvotes: 2

Related Questions