线程“main”中的异常 java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonParseException

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19487628/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 17:41:34  来源:igfitidea点击:

Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/Hymanson/JsonParseException

javaandroidjsonmaventwilio

提问by SpringLearner

I am using Twilio to send SMS messages from my web app and I have almost completed the integration. It's sending the SMS, but an error is being generated and I don't understand why. I have included a JSON dependency from this jsonand this file linkbut I'm still getting an error. Which other jar do I need to include?

我正在使用 Twilio 从我的 Web 应用程序发送 SMS 消息,并且我几乎完成了集成。它正在发送短信,但正在生成错误,我不明白为什么。我已经从这个json和这个文件链接中包含了一个 JSON 依赖项,但我仍然收到错误消息。我还需要包括哪些其他 jar?

Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/Hymanson/JsonParseException
    at com.twilio.sdk.TwilioRestResponse.getParser(TwilioRestResponse.java:225)
    at com.twilio.sdk.TwilioRestResponse.toMap(TwilioRestResponse.java:243)
    at com.twilio.sdk.resource.list.SmsList.create(SmsList.java:70)
    at Example.main(Example.java:25)
Caused by: java.lang.ClassNotFoundException: org.codehaus.Hymanson.JsonParseException
    at java.net.URLClassLoader.run(URLClassLoader.java:366)
    at java.net.URLClassLoader.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    ... 4 more

screenshot showing json added enter image description hereUpdate this is the new screesnshotenter image description here

显示添加了 json 的屏幕截图 在此处输入图片说明更新这是新的 screesnshot在此处输入图片说明

回答by Keerthivasan

You have missed Hymanson-core-asl.jar1.9.13 in you project. You can make use of this Maven POM dependency

你在你的项目中错过了Hymanson-core-asl.jar1.9.13。你可以利用这个 Maven POM 依赖

<dependency>
    <groupId>org.codehaus.Hymanson</groupId>
    <artifactId>Hymanson-core-asl</artifactId>
    <version>1.9.13</version>
</dependency>

Hope this solves your problem. Check this linkfor more information. Direct linkfor download

希望这能解决您的问题。查看此链接以获取更多信息。直接下载 链接

Class is present in the jar Screen below

类存在于下面的 jar 屏幕中

enter image description here

在此处输入图片说明

Remove your java-json.jar and add the Hymanson-core-asl.jar

删除你的 java-json.jar 并添加 Hymanson-core-asl.jar