我的buildConfig中有以下内容:
compile ":json-rest-api:1.0.11"
当我通过Eclipse STS查看我的类路径下的依赖项时,我可以看到包含 simple-json-1.1.jar 。
当我为部署构建战争时,我发现它不包含这个jar。 我需要在部署中测试推送通知。我现在得到了当前的错误,因为缺少了这个类:
2013-02-11 08:55:46,390 ERROR [STDERR] (Thread-85) org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: org/json/simple/parser/ParseException
2013-02-11 08:55:46,390 ERROR [STDERR] (Thread-85) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:97)
2013-02-11 08:55:46,390 ERROR [STDERR] (Thread-85) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
2013-02-11 08:55:46,390 ERROR [STDERR] (Thread-85) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1047)
2013-02-11 08:55:46,390 ERROR [STDERR] (Thread-85) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
2013-02-11 08:55:46,390 ERROR [STDERR] (Thread-85) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
2013-02-11 08:55:46,390 ERROR [STDERR] (Thread-85) at groovy.lang.Closure.call(Closure.java:412)
2013-02-11 08:55:46,390 ERROR [STDERR] (Thread-85) at groovy.lang.Closure.call(Closure.java:406)
2013-02-11 08:55:46,391 ERROR [STDERR] (Thread-85) at groovy.lang.Closure.run(Closure.java:490)
2013-02-11 08:55:46,391 ERROR [STDERR] (Thread-85) at java.lang.Thread.run(Thread.java:619)
2013-02-11 08:55:46,391 ERROR [STDERR] (Thread-85) Caused by: java.lang.NoClassDefFoundError: org/json/simple/parser/ParseException
2013-02-11 08:55:46,391 ERROR [STDERR] (Thread-85) at java.lang.Class.forName0(Native Method)
2013-02-11 08:55:46,391 ERROR [STDERR] (Thread-85) at java.lang.Class.forName(Class.java:169)
2013-02-11 08:55:46,391 ERROR [STDERR] (Thread-85) at com.mysite.notification.AndroidNotificationService.class$(AndroidNotificationService.groovy)
2013-02-11 08:55:46,391 ERROR [STDERR] (Thread-85) at com.mysite.notification.AndroidNotificationService.$get$$class$com$google$android$gcm$server$Sender(AndroidNotificationService.groovy)
2013-02-11 08:55:46,391 ERROR [STDERR] (Thread-85) at com.mysite.notification.AndroidNotificationService.sendMessage(AndroidNotificationService.groovy:22)
2013-02-11 08:55:46,393 ERROR [STDERR] (Thread-85) at com.mysite.notification.AndroidNotificationService$$FastClassByCGLIB$$5e8e3148.invoke(<generated>)
我是否需要明确将此设置在某处?它甚至是json-rest-api插件的依赖吗?
由于
答案 0 :(得分:3)
因此,在使用Ian建议的grails依赖项报告后,我发现它来自com.googlecode.json-simple
我在我的buildConfig.groovy中添加了以下内容,并在构建时正确地将其拉入:
dependencies {
compile 'org.json-simple:json-simple:1.1.1'
}