Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassNotFoundException: scala.Product$class #52

Open
srijitcn opened this issue Aug 12, 2022 · 1 comment
Open

ClassNotFoundException: scala.Product$class #52

srijitcn opened this issue Aug 12, 2022 · 1 comment

Comments

@srijitcn
Copy link

Hi,
I am trying to use this library to convert json-schema to Spark Structs. Using scala version 2.12.14

import org.zalando.spark.jsonschema.SchemaConverter
import scala.io.Source

val schemaUrl = "https://raw.githubusercontent.com/CMSgov/price-transparency-guide/master/schemas/allowed-amounts/allowed-amounts.json"
val html = Source.fromURL(schemaUrl)
val inputSchema = html.mkString
println(inputSchema)
val sparkSchema = SchemaConverter.convertContent(inputSchema)

I get the below exception

NoClassDefFoundError: scala/Product$class
Caused by: ClassNotFoundException: scala.Product$class
	at play.api.libs.json.JsObject.<init>(JsValue.scala:76)
	at play.api.libs.json.JsObject$.apply(JsValue.scala:155)
	at org.zalando.spark.jsonschema.SchemaConverter$.<init>(SchemaConverter.scala:44)
	at org.zalando.spark.jsonschema.SchemaConverter$.<clinit>(SchemaConverter.scala)
	at $line5694e0f58f7a402c8eec91ff13bcf9ab29.$read$$iw$$iw$$iw$$iw$$iw$$iw.<init>(command-2203313569958050:1)
	at $line5694e0f58f7a402c8eec91ff13bcf9ab29.$read$$iw$$iw$$iw$$iw$$iw.<init>(command-2203313569958050:45)
	at $line5694e0f58f7a402c8eec91ff13bcf9ab29.$read$$iw$$iw$$iw$$iw.<init>(command-2203313569958050:47)
	at $line5694e0f58f7a402c8eec91ff13bcf9ab29.$read$$iw$$iw$$iw.<init>(command-2203313569958050:49)

Any idea what I am doing wrong?

@simenojensen
Copy link

scala version and spark-json-schema version must use same version of scala

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants