我将Grails项目从grails-2.3.7升级到grails-2.4.0并遵循指南http://grails.org/doc/2.4.x/guide/upgradingFrom23.html。但是,尝试运行应用程序现在会产生下面的堆栈跟踪。我该如何解决这个问题?
| Running Grails application
| Error 2014-06-12 15:45:55,788 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'grailsApplicationPostProcessor': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/annotation/AnnotatedElementUtils
Message: Error creating bean with name 'grailsApplicationPostProcessor': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/annotation/AnnotatedElementUtils
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
Caused by NoClassDefFoundError: org/springframework/core/annotation/AnnotatedElementUtils
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
Caused by ClassNotFoundException: org.springframework.core.annotation.AnnotatedElementUtils
->> 366 | run in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 355 | run in ''
| 354 | findClass in java.net.URLClassLoader
| 425 | loadClass in java.lang.ClassLoader
| 262 | run . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
| Error Forked Grails VM exited with error
答案 0 :(得分:0)
请运行
grails dependency-report
并检查您的应用程序是否没有使用旧版本的Spring。如果您可以将输出粘贴到问题中,您应该在依赖关系报告中看到一些旧版本的Spring JAR,这会导致问题。 Grails 2.4需要Spring 4.0.5或更高版本