java.lang.NoSuchMethodError: com.google.common.io.ByteStreams.exhaust(Ljava/io/InputStream;)J
Getting above error msg , when using Guava - 18.0v with Cloud Storage - 2.2.2v:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
<version>3.2.0</version>
</dependency>
If I use Guava - 23v with Datastax -3.2.0v I'm getting below error msg:
java.lang.NoClassDefFoundError: com/google/common/util/concurrent/FutureFallback
so Cloud storage needs Guava version above 20 , but DataStax needs version below 20 , so either thing is working at a time but I want both the things.
My code:
StorageOptions options = StorageOptions.newBuilder()
.setProjectId(PROJECT_ID)
.setCredentials(GoogleCredentials
.fromStream(new FileInputStream(PATH_TO_JSON_KEY))).build();
Storage storage = options.getService();
Blob blob = storage.get(BUCKET_NAME, OBJECT_NAME);
ReadChannel r = blob.reader();