【Spark错误】Exception in thread “main“ java.lang.NoClassDefFoundError: org/json4s/Formats

Exception in thread “main” java.lang.NoClassDefFoundError: org/json4s/Formats

遇见这种异常,可以通过导入依赖的方式解决
比如在pom文件中导入如下maven依赖:

  <dependencies>
    <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>20160810</version>
    </dependency>
    <!--加入对commons-io的依赖-->
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.4</version>
    </dependency>
  </dependencies>

问题解决
参考:https://blog.csdn.net/liurui50/article/details/100560430

上一篇:动态代理报错:No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/aspectj


下一篇:Throwable、Error、Exception、RuntimeException 区别