Cannot start queries in SQLContext from Apache Spark SQL 1.5.2, getting java.lang.NoSuchMethodError

I have a Java application using Spark SQL ( Spark 1.5.2 using local mode), but I cannot execute any SQL commands without errors.

This is the code I execute:

//confs
SparkConf sparkConf = new SparkConf();  
sparkConf.set("spark.master","local");
sparkConf.set("spark.app.name","application01");
sparkConf.set("spark.driver.host","10.1.1.36");
sparkConf.set("spark.driver.port", "51810");
sparkConf.set("spark.executor.port", "51815");
sparkConf.set("spark.repl.class.uri","http://10.1.1.36:46146");
sparkConf.set("spark.executor.instances","2");
sparkConf.set("spark.jars","");
sparkConf.set("spark.executor.id","driver");
sparkConf.set("spark.submit.deployMode","client");
sparkConf.set("spark.fileserver.uri","http://10.1.1.36:47314");
sparkConf.set("spark.localProperties.clone","true");
sparkConf.set("spark.app.id","app-45631207172715-0002");

//Initialize contexts
JavaSparkContext sparkContext = new JavaSparkContext(sparkConf);
SQLContext sqlContext = new SQLContext(sparkContext);           

//execute command
sqlContext.sql("show tables").show();

Spark dependencies on pom.xml are as follows:

<dependency>
  <groupId>org.apache.spark</groupId>
  <artifactId>spark-core_2.10</artifactId>
  <version>1.5.2</version>
</dependency>

<dependency>
  <groupId>org.apache.spark</groupId>
  <artifactId>spark-sql_2.10</artifactId>
  <version>1.5.2</version>
</dependency>

<dependency>
  <groupId>org.apache.spark</groupId>
  <artifactId>spark-hive_2.10</artifactId>
  <version>1.5.2</version>
</dependency>

<dependency>
  <groupId>org.apache.spark</groupId>
  <artifactId>spark-repl_2.10</artifactId>
  <version>1.5.2</version>
</dependency>

Here is the error I get:

java.lang.NoSuchMethodError: com.fasterxml.jackson.module.scala.deser.BigDecimalDeserializer$.handledType()Ljava/lang/Class;

stack trace here .

My application is a web application running on Tomcat 7. I have no other configuration files. What can i do wrong? Could this be a dependency conflict, since I can run the same code in a clean project?

EDIT: issue, .

+4
2

BigDecimalDeserializer FasterXML/jackson-module- scala 2.4. :

<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-databind</artifactId>
  <version>2.4.4</version>
</dependency>
+1

NoSuchMethodError - maven.

, , , - .

, , , , -

jackson.databind pom.xml.

2.4.x jackson.databind.

. Maven 2.0.9 .

?

Maven 2.0.9 ​​ .

- , , . Maven 2.0 " ", , . , POM. , , Maven 2.0.8 , , , Maven 2.0.9 , : .

Maven Transitive Dependency

+5

Source: https://habr.com/ru/post/1619229/


All Articles