spark-submit Caused by: java.lang.ClassNotFoundException: org.codehaus.jettison.json.JSONObjec

出错情况:

spark-submit --driver-class-path /home/package/*:/opt/spark/jars/*:/opt/kafka/libs/*  --master spark://localhost:8088 --class Producer --executor-memory 500m /root/IdeaProjects/Case7/target/Case7.jar(错误命令)

 

spark-submit Caused by: java.lang.ClassNotFoundException: org.codehaus.jettison.json.JSONObjec_第1张图片

解决办法: 

在maven工程下载的包中,找出缺少的类,然后自己创建一个文件夹,把该类的  jar包  放进去,我的是  /root/lib  

正确命令:

spark-submit --driver-class-path /home/package/*:/root/lib/*:/opt/spark/jars/*:/opt/kafka/libs/*  --master spark://localhost:8088 --class Producer --executor-memory 500m /root/IdeaProjects/Case7/target/Case7.jar

 

像ClassNotFoundException这种异常都可以使用此方法,在spack-submit中    

其中Case7.jar的来源:

spark-submit Caused by: java.lang.ClassNotFoundException: org.codehaus.jettison.json.JSONObjec_第2张图片

你可能感兴趣的:(大数据)