title: java.lang.NoSuchMethodError: com.google.common.io.ByteStreams.exhaust(Ljava/io/InputStream;)J
body: <p>I'm getting this "java.lang.NoSuchMethodError: com.google.common.io.ByteStreams.exhaust(Ljava/io/InputStream;)J" error while using ServiceCredentials.fromStream() method. Anyone here faced this and know a fix? TIA</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
  http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;[title]&lt;/groupId&gt;
  &lt;artifactId&gt;calendar-event-consumer&lt;/artifactId&gt;
  &lt;version&gt;0.1&lt;/version&gt;
  &lt;name&gt;${project.artifactId}&lt;/name&gt;
  &lt;description&gt;Service that listens for events in a queue to push them 
  to an external API&lt;/description&gt;
  &lt;inceptionYear&gt;2017&lt;/inceptionYear&gt;
  
  &lt;packaging&gt;jar&lt;/packaging&gt;
  
  &lt;properties&gt;
  &lt;maven.compiler.source&gt;1.6&lt;/maven.compiler.source&gt;
  &lt;maven.compiler.target&gt;1.6&lt;/maven.compiler.target&gt;
  &lt;encoding&gt;UTF-8&lt;/encoding&gt;
  &lt;scala.version&gt;2.11.5&lt;/scala.version&gt;
  &lt;scala.compat.version&gt;2.11&lt;/scala.compat.version&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
    &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
    &lt;version&gt;${scala.version}&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- Test --&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;junit&lt;/groupId&gt;
    &lt;artifactId&gt;junit&lt;/artifactId&gt;
    &lt;version&gt;4.11&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.specs2&lt;/groupId&gt;
    &lt;artifactId&gt;specs2-core_${scala.compat.version}&lt;/artifactId&gt;
    &lt;version&gt;2.4.16&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.scalatest&lt;/groupId&gt;
    &lt;artifactId&gt;scalatest_${scala.compat.version}&lt;/artifactId&gt;
    &lt;version&gt;2.2.4&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;!-- https://mvnrepository.com/artifact/com.rabbitmq/amqp-client --&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.rabbitmq&lt;/groupId&gt;
    &lt;artifactId&gt;amqp-client&lt;/artifactId&gt;
    &lt;version&gt;4.2.0&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api --&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
    &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
    &lt;version&gt;1.7.21&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- https://mvnrepository.com/artifact/ch.qos.logback/logback- 
  classic --&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
    &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
    &lt;version&gt;1.2.3&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!--JSON parsing--&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.json4s&lt;/groupId&gt;
    &lt;artifactId&gt;json4s-native_2.11&lt;/artifactId&gt;
    &lt;version&gt;3.5.3&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!--Google Calendar API--&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.google.api-client&lt;/groupId&gt;
    &lt;artifactId&gt;google-api-client&lt;/artifactId&gt;
    &lt;version&gt;1.22.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.google.oauth-client&lt;/groupId&gt;
    &lt;artifactId&gt;google-oauth-client-jetty&lt;/artifactId&gt;
    &lt;version&gt;1.22.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.google.apis&lt;/groupId&gt;
    &lt;artifactId&gt;google-api-services-calendar&lt;/artifactId&gt;
    &lt;version&gt;v3-rev254-1.22.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.google.auth&lt;/groupId&gt;
    &lt;artifactId&gt;google-auth-library-oauth2-http&lt;/artifactId&gt;
    &lt;version&gt;0.20.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
    &lt;artifactId&gt;guava&lt;/artifactId&gt;
    &lt;version&gt;23.0&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!--Slick --&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.typesafe.slick&lt;/groupId&gt;
    &lt;artifactId&gt;slick_2.11&lt;/artifactId&gt;
    &lt;version&gt;3.2.1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java - 
  -&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;mysql&lt;/groupId&gt;
    &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
    &lt;version&gt;6.0.6&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.typesafe&lt;/groupId&gt;
    &lt;artifactId&gt;config&lt;/artifactId&gt;
    &lt;version&gt;1.3.1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.typesafe.slick&lt;/groupId&gt;
    &lt;artifactId&gt;slick-hikaricp_2.11&lt;/artifactId&gt;
    &lt;version&gt;3.2.1&lt;/version&gt;
  &lt;/dependency&gt;
  
  
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
  &lt;sourceDirectory&gt;src/main/scala&lt;/sourceDirectory&gt;
  &lt;testSourceDirectory&gt;src/test/scala&lt;/testSourceDirectory&gt;
  &lt;plugins&gt;
    &lt;plugin&gt;
      &lt;!-- see http://davidb.github.com/scala-maven-plugin --&gt;
      &lt;groupId&gt;net.alchim31.maven&lt;/groupId&gt;
      &lt;artifactId&gt;scala-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.2.0&lt;/version&gt;
      &lt;configuration&gt;
        &lt;args&gt;
          &lt;arg&gt;-Xmax-classfile-name&lt;/arg&gt;
          &lt;arg&gt;128&lt;/arg&gt;
        &lt;/args&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;goals&gt;
            &lt;goal&gt;compile&lt;/goal&gt;
            &lt;goal&gt;testCompile&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
            &lt;args&gt;
              &lt;arg&gt;-deprecation&lt;/arg&gt;
              &lt;arg&gt;-dependencyfile&lt;/arg&gt;
  
  &lt;arg&gt;${project.build.directory}/.scala_dependencies&lt;/arg&gt;
            &lt;/args&gt;
          &lt;/configuration&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
    &lt;/plugin&gt;
    &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.18.1&lt;/version&gt;
      &lt;configuration&gt;
        &lt;useFile&gt;false&lt;/useFile&gt;
        &lt;disableXmlReport&gt;true&lt;/disableXmlReport&gt;
        &lt;!-- If you have classpath issue like NoDefClassError,... --&gt;
        &lt;!-- useManifestOnlyJar&gt;false&lt;/useManifestOnlyJar --&gt;
        &lt;includes&gt;
          &lt;include&gt;**/*Test.*&lt;/include&gt;
          &lt;include&gt;**/*Suite.*&lt;/include&gt;
        &lt;/includes&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
    &lt;plugin&gt;
      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
      &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.6.0&lt;/version&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;goals&gt;
            &lt;goal&gt;exec&lt;/goal&gt;
          &lt;/goals&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
      &lt;configuration&gt;
        &lt;executable&gt;maven&lt;/executable&gt;
        &lt;workingDirectory&gt;/tmp&lt;/workingDirectory&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
    &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.4&lt;/version&gt;
      &lt;configuration&gt;
        &lt;descriptorRefs&gt;
          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
        &lt;/descriptorRefs&gt;
        &lt;archive&gt;
          &lt;manifest&gt;
            &lt;mainClass&gt;com.qpercom.App&lt;/mainClass&gt;
          &lt;/manifest&gt;
        &lt;/archive&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;phase&gt;package&lt;/phase&gt;
          &lt;goals&gt;
            &lt;goal&gt;single&lt;/goal&gt;
          &lt;/goals&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
    &lt;/plugin&gt;
  &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Error Log:</p>
  
  <blockquote>
    <p>17:40:54.163 [pool-1-thread-3] INFO  c.q.c.rabbitmq.RabbitMQEventConsumer - Received message of type class
    com.qpercom.model.CreateOrUpdateEventMessage on event (185,
    omis19demo) 17:40:54.626 [pool-1-thread-3] INFO 
    com.zaxxer.hikari.HikariDataSource - googleApiDb - Started.
    17:40:55.553 [pool-1-thread-3] INFO  c.q.c.google.GoogleCalendarPusher
        - Creating event in Google Calendar 17:40:55.690 [pool-1-thread-3] INFO  c.q.c.google.GoogleCalendarPusher - Instantiating Google
    Calendar Service... 17:40:57.063 [pool-1-thread-3] ERROR
    c.q.c.rabbitmq.RabbitMQEventConsumer - Failed pushing event. The
    message has been re-queued. Trace of exception:
    java.lang.NoSuchMethodError:
    com.google.common.io.ByteStreams.exhaust(Ljava/io/InputStream;)J
    17:40:57.065 [pool-1-thread-3] ERROR
    c.r.c.impl.ForgivingExceptionHandler - Consumer
    com.qpercom.consumer.rabbitmq.RabbitMQEventConsumer$$anon$1@56acb716
    (amq.ctag-CJwhF_0CeOmwK1kBKrQLXw) method handleDelivery for channel
    AMQChannel(amqp://zdMBDgTdd9fMMJft@3.249.159.145:5672/,1) threw an
    exception for channel
    AMQChannel(amqp://zdMBDgTdd9fMMJft@3.249.159.145:5672/,1)
    java.lang.NoSuchMethodError:
    com.google.common.io.ByteStreams.exhaust(Ljava/io/InputStream;)J  at
    com.google.api.client.http.ConsumingInputStream.close(ConsumingInputStream.java:40)
      at
    com.fasterxml.jackson.core.json.UTF8StreamJsonParser._closeInput(UTF8StreamJsonParser.java:237)
      at
    com.fasterxml.jackson.core.base.ParserBase.close(ParserBase.java:345)
      at
    com.fasterxml.jackson.core.json.UTF8StreamJsonParser.close(UTF8StreamJsonParser.java:808)
      at
    com.google.api.client.json.jackson2.JacksonParser.close(JacksonParser.java:50)
      at com.google.api.client.json.JsonParser.parse(JsonParser.java:365)
      at com.google.api.client.json.JsonParser.parse(JsonParser.java:337)
      at
    com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:79)
      at
    com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:73)
      at
    com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:444)
      at
    com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:447)
      at
    com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:157)
      at
    com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:145)
      at
    com.google.auth.oauth2.ServiceAccountCredentials.getRequestMetadata(ServiceAccountCredentials.java:603)
      at
    com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:91)
      at
    com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:88)
      at
    com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:300)
      at
    com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
      at
    com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
      at
    com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
      at
    com.qpercom.calendar.google.GoogleCalendarPusher.colorIdFor(GoogleCalendarPusher.scala:145)
      at
    com.qpercom.calendar.google.GoogleCalendarPusher.doCreate(GoogleCalendarPusher.scala:54)
      at
    com.qpercom.calendar.google.GoogleCalendarPusher.doCreate(GoogleCalendarPusher.scala:25)
      at
    com.qpercom.calendar.AbstractAPICalendarPusher.pushCreateOrUpdate(AbstractAPICalendarPusher.scala:74)
      at com.qpercom.App$$anonfun$main$1.apply(App.scala:26)  at
    com.qpercom.App$$anonfun$main$1.apply(App.scala:22)   at
    com.qpercom.consumer.rabbitmq.RabbitMQEventConsumer$$anon$1.handleDelivery(RabbitMQEventConsumer.scala:49)
      at
    com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
      at
    com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
      at
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)</p>
  </blockquote>