databricks / spark-xml

XML data source for Spark SQL and DataFrames
Apache License 2.0
505 stars 227 forks source link

NoClassDefFoundError: scala/$less$colon$less #576

Closed carlosg-m closed 2 years ago

carlosg-m commented 2 years ago
val df = spark.read.format("com.databricks.spark.xml").load("dbfs:/FileStore/example.xml")
# NoClassDefFoundError: scala/$less$colon$less
# Caused by: ClassNotFoundException: scala.$less$colon$less

Spark 3.2.1 Scala 2.12

srowen commented 2 years ago

You are probably using a Scala 2.11 build of the project. Use _2.12

sanyam-dev commented 1 year ago

I'm using java and I face similar issue, what should I do?

srowen commented 1 year ago

Same answer. You need to match library scala version to the scala version that your Spark uses.