title: Listing buckets with Google Cloud Storage resulting in NoSuchMethodError, Java AppEngine
body: <p>Trying to just list the buckets in my Google Cloud Storage project but can't quite understand why i keep getting the following error:</p>
  
  <blockquote>
    <p>java.lang.NoSuchMethodError:
    com.google.api.services.storage.model.Bucket.getIamConfiguration()Lcom/google/api/services/storage/model/Bucket$IamConfiguration;</p>
  </blockquote>
  
  <p>I'm testing it with the following servlet:</p>
  
  <pre><code>package servlets;
  
  import java.io.IOException;
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import com.google.cloud.storage.Bucket;
  import com.google.cloud.storage.Storage;
  import com.google.cloud.storage.StorageOptions;
  
  @WebServlet("/Test")
  public class Test extends HttpServlet {
      private static final long serialVersionUID = 1L;
  
      public Test() {
          super();
      }
  
  
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
          Storage storage = StorageOptions.getDefaultInstance().getService();
          for (Bucket bucket : storage.list().iterateAll()) { //this line is giving the error
              response.getWriter().write(bucket.getName());
          }
      }
  }
  </code></pre>
  
  <p>In my pom i have:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.google.appengine.tools&lt;/groupId&gt;
      &lt;artifactId&gt;appengine-gcs-client&lt;/artifactId&gt;
      &lt;version&gt;0.8&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.google.cloud&lt;/groupId&gt;
      &lt;artifactId&gt;google-cloud-storage&lt;/artifactId&gt;
      &lt;version&gt;1.64.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>The former dependency isn't required for this specific example but i need it for another part of the application, I suspect this might be where the problem lies. Any ideas what could be going wrong? </p>