Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java scala/spark项目的Eclipse错误_Java_Eclipse_Scala - Fatal编程技术网

Java scala/spark项目的Eclipse错误

Java scala/spark项目的Eclipse错误,java,eclipse,scala,Java,Eclipse,Scala,我目前正在使用EclipseScalaIDE开发spark流媒体作业。 一开始它工作得很好:我用一个.scala文件和一个java main创建了java项目,向项目添加了scala特性,导入了spark libs,在java one中称为scala main,所有这些都工作得很好。 现在我做了完全相同的事情,我创建了其他项目,并且(没有代码错误)我的项目有一些错误 这些错误如下: SBT builder crashed while compiling. The error message is

我目前正在使用EclipseScalaIDE开发spark流媒体作业。 一开始它工作得很好:我用一个.scala文件和一个java main创建了java项目,向项目添加了scala特性,导入了spark libs,在java one中称为scala main,所有这些都工作得很好。 现在我做了完全相同的事情,我创建了其他项目,并且(没有代码错误)我的项目有一些错误

这些错误如下:

SBT builder crashed while compiling. The error message is 'bad symbolic reference. A signature in SparkFlumeEvent.class refers to term avro in value org.apache.source which is not available. It may be completely missing from the current classpath, or the version on the classpath might be incompatible with the version used when compiling SparkFlumeEvent.class.'. ViewLog     Unknown Scala Problem

Error in Scala compiler: bad symbolic reference. A signature in SparkFlumeEvent.class refers to term avro in value org.apache.source which is not available. It may be completely missing from the current classpath, or the version on the classpath might be incompatible with the version used when compiling SparkFlumeEvent.class.                                     ViewLog     Unknown Scala Problem

bad symbolic reference. A signature in SparkFlumeEvent.class refers to term source in value org.apache.flume which is not available. It may be completely missing from the current classpath, or the version on the classpath might be incompatible with the version used when compiling SparkFlumeEvent.class.                                                             ViewLog     Unknown Scala Problem

bad symbolic reference. A signature in SparkFlumeEvent.class refers to term flume in package org.apache which is not available. It may be completely missing from the current classpath, or the version on the classpath might be incompatible with the version used when compiling SparkFlumeEvent.class.                                                                  ViewLog     Unknown Scala Problem
似乎我在构建路径中的lib设置不正确,这很奇怪,因为我在其他项目上做了完全相同的事情,使用了相同的库,并且一切都很正常。。。我试图清理所有项目,关闭所有项目,但这一个,但我仍然得到错误

启动项目时,出现以下错误:

java.lang.NoClassDefFoundError: viewLog/Main
Caused by: java.lang.ClassNotFoundException: viewLog.Main
    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)-

看起来您的类路径不完整。特别是,您缺少ApacheAvro,可能还缺少Flume。这些是Spark本身的依赖项,因此除了Spark JAR之外,还需要添加它的依赖项


最简单的方法是使用Sbt构建,在中有一个示例,然后使用Sbt Eclipse导出Eclipse项目。

你是对的,即使我的所有导入在代码中都是正确的,但jar中似乎存在一种奇怪的依赖性,在添加flure core jar和flume sdk jar之后,一切都正常