引起:java.lang.ClassNotFoundException:scala.ScalaObject

时间:2017-08-30 07:49:44

标签: scala apache-spark apache-spark-sql

我正在运行一个火花代码,并在eclipse中运行作业时面临下面的问题。

update account_move_line aml set tax_number =  (
   select no_pajak as tax_number from account_invoice_line 
   where invoice_id = aml.invoice_id and no_pajak is not NULL  
)  
where tax_number is NULL and date > '2017-08-01'

我有火花版2.0.0,我使用scala-library版本是2.11.8。 请参阅eclipse中包含的jar文件。 jars 请在下面找到我在eclipse中运行的代码。

Exception in thread "main" java.lang.NoClassDefFoundError: scala/ScalaObject
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
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)
at org.apache.spark.serializer.SerializerManager.<init>   (SerializerManager.scala:36)
at org.apache.spark.SparkEnv$.create(SparkEnv.scala:266)
at org.apache.spark.SparkEnv$.createDriverEnv(SparkEnv.scala:165)
at org.apache.spark.SparkContext.createSparkEnv(SparkContext.scala:259)
at org.apache.spark.SparkContext.<init>(SparkContext.scala:423)
at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:58)
at GroupBy.SparkDataSets.main(SparkDataSets.java:70)
Caused by: java.lang.ClassNotFoundException: scala.ScalaObject
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)
... 19 more

我已经在eclipse中添加了所有必需版本的Spark和scala,但仍然面临着这个问题。让我知道scala的确切版本,我可以用来解决这个问题。

0 个答案:

没有答案