title: Retrofit GET results in a stack size error, 1036 KB
body: <p>I have been trying to apply the RetroFit REST Client in my application and I have run into a problem, that I can not seem to solve. I try to download a .json file (services.hanselandpetal.com/feeds/flowers.json) and after several seconds of downloading I keep getting a stackoverflow error:</p>
  
  <p>"com.dbflowtest.MainActivity﹕ retrofit.RetrofitError: stack size 1036KB". </p>
  
  <p>Below the code that I use:</p>
  
  <p>FlowerAPI.java</p>
  
  <pre><code>public interface FlowerAPI {
  
      @GET("/feeds/flowers.json")
      public void getFeed(Callback&lt;List&lt;Flower&gt;&gt; response); 
  }
  </code></pre>
  
  <p>MainActivity.java</p>
  
  <pre><code>private void requestFlowers() {
      RestAdapter adapter = new RestAdapter.Builder()
              .setEndpoint(ENDPOINT)
              .build();
  
      FlowerAPI api = adapter.create(FlowerAPI.class);
  
      api.getFeed(new Callback&lt;List&lt;Flower&gt;&gt;() {
  
          @Override
          public void success(List&lt;Flower&gt; flowers, Response response) {
              Log.d(TAG, "Received flowers.")
          }
  
          @Override
          public void failure(RetrofitError error) {
              Log.d(TAG, error.toString());
          }
      });
  }
  </code></pre>
  
  <p>Flower.java</p>
  
  <pre><code>@Table(databaseName = AppDatabase.NAME) 
  public class Flower extends BaseModel {
  
      @Column(columnType = Column.PRIMARY_KEY)
      public int productId;
  
      @Column
      public String category;
  
      @Column
      public double price;
  
      @Column
      public String instructions;
  
      @Column
      public String photo;
  
      @Column
      public String name;
  
      private List&lt;Flower&gt; flowers;
  
      public Flower() {}
  
      public Flower(int productId, String category, double price, String instructions, String photo, String name) {
          this.productId = productId;
          this.category = category;
          this.price = price;
          this.instructions = instructions;
          this.photo = photo;
          this.name = name;
      }
  
      public List&lt;Flower&gt; getFlowers() {
          if(flowers == null) {
              flowers = new Select()
                  .from(Flower.class)
                  .queryList();
          }
          return flowers;
      }
  }
  </code></pre>
  
  <p>I cannot seem to solve this problem. Any help is greatly appreciated, as I would really like to use this framework :).</p>
  
  <p>SOLVED</p>
  
  <p>For some reason I get this stack size problem when I use the POJO for both Retrofit and DBFlow. So instead of having 1 Flower.java class, I made another named FlowerDB.java. This solved my problem!</p>