无法运行Grails项目GGTS(Could not run Grails project GGTS

2019-09-01 09:01发布

我有一个在命令行中运行一个完美Grails项目。 当我尝试用它运行在GGTS

grails run-app

它第一次运行时没有任何错误。 于是,我停止了服务器,并使用Grails运行应用程序再次运行它。 现在出现以下错误。

| Error 2013-04-29 15:32:14,965 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing the application: Error creating bean with name 'annotationHandlerMapping': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/codehaus/jackson/annotate/JacksonAnnotation
Message: Error creating bean with name 'annotationHandlerMapping': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/codehaus/jackson/annotate/JacksonAnnotation
Line | Method
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread
Caused by NoClassDefFoundError: org/codehaus/jackson/annotate/JacksonAnnotation
->> 3098 | initAnnotationsIfNecessary in java.lang.Class
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   3057 | getAnnotation in     ''
|   3070 | isAnnotationPresent in     ''
|    334 | innerRun  in java.util.concurrent.FutureTask$Sync
|    166 | run . . . in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run       in java.lang.Thread
Caused by ClassNotFoundException: org.codehaus.jackson.annotate.JacksonAnnotation
->>  175 | findClass in org.codehaus.groovy.tools.RootLoader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    423 | loadClass in java.lang.ClassLoader
|    147 | loadClass in org.codehaus.groovy.tools.RootLoader
|    356 | loadClass in java.lang.ClassLoader
|   3098 | initAnnotationsIfNecessary in java.lang.Class
|   3057 | getAnnotation in     ''
|   3070 | isAnnotationPresent in     ''
|    334 | innerRun  in java.util.concurrent.FutureTask$Sync
|    166 | run . . . in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run       in java.lang.Thread

我也试着删除.grails / 2.2.1 /项目/ MyProject的目录和更新的依赖关系。 刷新依赖工作正常,但运行的应用程序不GGTS工作。 我该怎么办?

Answer 1:

像往常一样,尝试按以下顺序如下

grails clean
grails refresh-dependencies
grails run-app

如果仍然无法正常工作,您可能需要删除您.grails / 2.2.2 /项目/ *,并重复上述步骤。



Answer 2:

事实证明,这个问题是由Java 7的版本引起的。 不要用户更新21那么错误就会消失。



文章来源: Could not run Grails project GGTS