jackson-databind conflicts with Spark's
See original GitHub issueI am trying reading a CSV file using dataframes (Spark 2.2.0) like so:
Dataset<Row> df = spark.read()
.format("csv")
.option("sep", "\t")
.option("header", "true")
.option("inferSchema", "true")
.load("/tmp/example.csv");
This fails with a Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
exception. This is the content of the pom.xml
file:
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.lucidworks.spark</groupId>
<artifactId>spark-solr</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>
The jackson-databind version (2.4.0) is omitted due to a conflict with Spark’s 2.6.5 version. Can it be updated?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Conflicts in spark-core dependencies. How does it work?
7 introduced dependencies conflict between jackson-databind itself. Where am I wrong in my reasoning?
Read more >Win over Spark distribution's dependency conflicts with SBT ...
How SBT shade plugin can solve dependency conflicts between your jobs JAR and Spark distribution's Jars.
Read more >[#BEAM-9239] Dependency conflict with Spark using aws io
Starting with beam 2.17.0 I get this error in the Spark 2.4.4 driver when aws io is also used: java.lang.
Read more >Oozie job with spark2 action fails with Jackson ve... - 248490
Due to conflict in Jackson jar versions, Oozie job with spark2 action(spark action with spark2 sharelib) may get failed with below error:
Read more >Maven dependency conflict resolution is annoying
one of the Spark libraries depends on jackson-databind version 2.6. · jackson-databind depends on jackson-core 2.6. · Some other dependency in my ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Excluding any version of
jackson-databind
does not work. Adding it explicitly to the pom file (together with its related packages) apparently solves the problem:Just stumbled across this same problem. I believe the correct solution when targeting spark
2.2.0
and spark-solr3.3.4
version is to just list the spark-solr dependency as follows:With this approach there is no need to include specific versions of the
jackson-core
,jackson-databind
, andjackson-annotations
as the correct versions will be transitively included via the spark dependencies.