我试图运行我的grails项目,该项目从2.3.5升级到2.4.4。
现在,在尝试运行它之后,出现以下错误:
|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
最佳答案
根据Grail的迁移文档,看起来他们已经从2.4中删除了ConfigurationHolder。
您需要更新休眠插件。
从他们的文档:
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.
迁移文档:http://grails.github.io/grails-doc/2.4.x/guide/upgradingFrom23.html
关于grails - 我该如何解决: “ClassDefFoundError: org/codehaus/groovy/grails/commons/ConfigurationHolder”?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29050378/