question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing maven dependencies when using --packages and ClassNotFound when using --jars

See original GitHub issue

Hi,

I want to play a little bit with the BigQuery connector (on AWS EMR version 5.24.1 with Spark 2.4.2) and run this command: pyspark --packages com.google.cloud.spark:spark-bigquery_2.11:0.9.1-beta. But the following three dependencies seem to be missing in maven central:

  • javax.jms#jms;1.1!jms.jar
  • com.sun.jdmk#jmxtools;1.2.1!jmxtools.jar
  • com.sun.jmx#jmxri;1.2.1!jmxri.jar

As a workaround, I tried to download the JAR from here: https://console.cloud.google.com/storage/browser/spark-lib/bigquery and add it to the classpath with this command: pyspark --jars spark-bigquery-latest.jar. But when I tried to read a table from BigQuery, I get this error: ClassNotFoundException: Failed to find data source: com.google.cloud.spark.bigquery.

I also tried to use com.google.cloud.spark.bigquery instead of just “bigquery” in format(), without success.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
juliankeppelcommented, Nov 6, 2019

Okay, now it works with:

pyspark \     
    --files <path-to-credential-file> \
    --conf spark.executorEnv.GOOGLE_APPLICATION_CREDENTIALS=<name-of-credential-file> \
    --conf spark.yarn.appMasterEnv.GOOGLE_APPLICATION_CREDENTIALS=<name-of-credential-file> \
    --jars <path-to-bigquery-lib-jar> \

And in the code just:

spark.read.format("bigquery").option("table", "publicdata.samples.shakespeare").load()

Thanks a lot for your support!

1reaction
davidrabinowitzcommented, Oct 17, 2019

Created #72 to handle the --packages issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

NoClassDefFoundError on Maven dependency - Stack Overflow
I created a Maven project with Eclipse and added dependencies, and it was working without problems. But when I try to run it...
Read more >
3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
A simple example of NoClassDefFoundError is class belongs to a missing JAR file or JAR was not added into classpath or sometimes jar's...
Read more >
How to fix Maven build issue in Eclipse? Perform ... - Crunchify
Use “maven-shade-plugin” to Create just 1 Executable jar with all required Dependencies in it for your Java or Spring Project? Eclipse IDE ...
Read more >
Geotools with maven: java.lang.noclassdeffounderror while ...
geotools:gt-shapefile:jar:sources:19-20180108.192838-162 is missing, no dependency information available [WARNING] Could not get sources for org ...
Read more >
SonarQube 6.2 / sonar-packaging-maven-plugin
SonarQube 6.2 / sonar-packaging-maven-plugin : Missing Guava dependency ... run the analysis using this plugin, I got the below ClassNotFoundException error ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found