本文介绍了线程“ main”中的异常java.lang.NoClassDefFoundError:com / twitter / chill / KryoBase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用javas编写一个简单的spark-cassandra程序,带有datastax cassandra,但低于异常

I am writing a simple spark-cassandra program in java with datastax cassandra but getting below exception

pom.xml

 <dependency>
        <groupId>com.datastax.dse</groupId>
        <artifactId>dse-spark-dependencies</artifactId>
        <version>5.1.1</version>
        <exclusions>
            <exclusion>
                <groupId>com.datastax.dse</groupId>
                <artifactId>dse-java-driver-core</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.solr</groupId>
                <artifactId>solr-solrj</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

App.java

 SparkConf conf = new SparkConf().setMaster("local").setAppName("SparkJavaFirst")
                    .set("spark.cassandra.connection.host", "localhost");
JavaSparkContext sc = new JavaSparkContext(conf);
JavaRDD<CassandraRow> cassandraJavaRDD =  CassandraJavaUtil.javaFunctions(sc).
                    cassandraTable("my_keyspace","my_table" ).
                    select("my_column");

程序在 JavaSparkContext sc = new JavaSparkContext(conf);失败

任何帮助将不胜感激。

Any help will be appreciated.

推荐答案

此问题已解决,因为我删除了

This issue got resolved as I removed the exclusion of

 <groupId>com.datastax.dse</groupId>
  <artifactId>dse-java-driver-core</artifactId>

这篇关于线程“ main”中的异常java.lang.NoClassDefFoundError:com / twitter / chill / KryoBase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 17:15