gpt4 book ai didi

grails - 如何在Grails War构建中包含simple-json

转载 作者:行者123 更新时间:2023-12-02 14:25:37 30 4
gpt4 key购买 nike

我的buildConfig中有以下内容:

compile ":json-rest-api:1.0.11"

当我通过Eclipse STS在类路径下查看依赖项时,可以看到其中包含了simple-json-1.1.jar。

建立部署 war 时,我发现它不包含此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插件吗?

谢谢

最佳答案

因此,在按照Ian的建议使用grails依赖项报告后,我发现它来自com.googlecode.json-simple

我在我的buildConfig.groovy中添加了以下内容,并在构建时将其正确拉入:

dependencies {      
compile 'org.json-simple:json-simple:1.1.1'
}

关于grails - 如何在Grails War构建中包含simple-json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14830748/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com