gpt4 book ai didi

java - 使用 json-schema-validator-2.2.6 时出现异常 java.lang.NoClassDefFoundError

转载 作者:太空宇宙 更新时间:2023-11-04 12:52:32 25 4
gpt4 key购买 nike

我正在尝试对 this link 中给出的代码使用 json-schema validator 使用 Eclipse..

有一个主类读取两个 .json 文件(架构和 json 数据)如果使用(ValidationUtils.isJsonValid(schemaFile, jsonFile))来验证它们,则使用ValidationUtils类来验证它们,该类获取架构文件和json文件并对其进行验证..

但是我收到以下错误..并且我不知道如何修复它..请帮忙?

Exception in thread "main" java.lang.NoClassDefFoundError: com/github/fge/msgsimple/bundle/PropertiesBundle at com.github.fge.jackson.JsonNodeReader.(JsonNodeReader.java:66) at com.github.fge.jackson.JsonLoader.(JsonLoader.java:50) at com.wilddiary.json.ValidationUtils.getJsonNode(ValidationUtils.java:30) at com.wilddiary.json.ValidationUtils.getSchemaNode(ValidationUtils.java:55) at com.wilddiary.json.ValidationUtils.isJsonValid(ValidationUtils.java:99) at com.wilddiary.json.Main.main(Main.java:18) Caused by: java.lang.ClassNotFoundException: com.github.fge.msgsimple.bundle.PropertiesBundle at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 6 more

我正在使用:

  • json-schema-validator-2.2.6
  • json-schema-core-1.2.5
  • jackson coreutils 1.8
  • jackson 数据绑定(bind) 2.7.2
  • jackson 注释 2.7.2
  • com.fasterxml.jackson.core.jar

最佳答案

该异常意味着类 com.github.fge.msgsimple.bundle.PropertiesBundle 不存在于您的运行时类路径中。要解决此问题,您应该下载 msg-simple-0.9.jar ( http://mvnrepository.com/artifact/com.github.fge/msg-simple/0.9 ) 并将其放入您的类路径中。

关于java - 使用 json-schema-validator-2.2.6 时出现异常 java.lang.NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35680424/

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