spark2升级spark3问题记录:
-
scala.Predef$.refArrayOps([Ljava/lang/Object;)
spark2.3.2使用scala2.11.8版本,spark3.1.1使用scala2.12.14版本,sacla低版本打包导致,推荐切换scala2.12.10版本进行打包
- java.lang.NoClassDefFoundError:org/apache/commons/configuration/XMLConfiguration
spark2集群运行依赖jars包含commons-configuration-1.6.jar
spark3集群运行依赖jars包含commons-configuration2-2.1.1.jar
针对上述问题有以下两种解决方案:
①将commons-configuration-1.6.jar放入spark3/jars目录,可使代码依赖的低版本类找到
②一劳永逸办法:针对新版本commons-configuration2-2.1.1.jar进行适配改造
可参考以下大佬博客链接:
https://dandelioncloud.cn/article/details/1533352425436246017
- java.lang.NoClassDefFoundError:org/apache/spark/AccumulatorV2Param
Accumulator方法在spark3.x版本已过期删除,Accumulator在spark3.x替换为AccumulatorV2
![在这里插入图片描述](https://img-blog.csdnimg.cn/71318bd233554be2bdb268ce4cd57b83.png)