java.lang.NoClassDefFoundError: StorageOptions
See original GitHub issueBeen recently dealing with issues regarding Guava versions within Hadoop and the rest used by other components.
After getting rid of the MethodNotFound errors regarding Preconditions I’ve came to another exception which I can’t really understand as the library is provided within the sbt file…
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/cloud/storage/StorageOptions
Taking into account this libraries and versioning.
val googleCloudV = "1.89.0"
val googleHadoopV = "hadoop3-2.0.0"
val cloudStorage = "com.google.cloud" % "google-cloud-storage" % googleCloudV
val cloudHadoop = "com.google.cloud.bigdataoss" % "gcs-connector" % googleHadoopV
I’ve also tried setting cloudStorage
as "provided"
but I’m getting, in that case, the same exception regarding Guava.
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
I’ve already included shadowing to avoid conflict with Hadoop dependencies.
assemblyShadeRules in assembly := Seq(ShadeRule.rename("com.google.**" -> "shadeio.@1").inAll)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
Adding google-cloud-storage to maven - NoClassDefFoundError
java.lang.NoClassDefFoundError: com/google/cloud/http/CensusHttpModule at ... getStorageRpcV1(StorageOptions.java:120).
Read more >How to solve java.lang.NoClassDefFoundError: com/google ...
In this tutorial, we help you how to solve the error "java.lang.NoClassDefFoundError: com/google/cloud/http/HttpTransportOptions"
Read more >java.lang.NoClassDefFoundError: com/google/api/services ...
Uncaught exception from servlet java.lang.NoClassDefFoundError: com/google/api/services/servicemanagement/ServiceManagement$Builder.
Read more >com.google.cloud.storage.StorageOptions java code examples
Best Java code snippets using com.google.cloud.storage.StorageOptions (Showing top 20 results out of 315). Refine search Refine arrow. StorageException.
Read more >spring-cloud-gcp/Lobby - Gitter
... got to be due to downstream dependencies getting upgraded: "Caused by: java.lang.ClassNotFoundException: brave. ... Storage storage = StorageOptions.
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 Free
Top 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
@turboT4 I tried your depenedencies and made small changes in your config, it’s work for me. Could you try below sbt config ?
Absolutely @pmakani , here it goes. I also had AWS SDK dependencies (together with their Hadoop, but clean it up for sake of clarity, because without those dependencies it still raises the error, even after removing cache and all related files).
EDIT: Just pasting the sbt and saw my own mistake… Shadowing was being applied outter the module I wanted it to be done so.