title: Error setting expression X with value [Ljava.lang.String;@......]
body: <p>I am getting sometimes and sometimes not weird error: </p>
  
  <pre><code>Error setting expression X with value [Ljava.lang.String;@......]
  </code></pre>
  
  <p>It sometimes occurs and sometimes not. It is quiet annoying. The error sometimes comes from this class:</p>
  
  <pre><code>package com.coreRestaurant.menuItem;
  
  import com.google.gson.Gson;
  import com.opensymphony.xwork2.ActionSupport;
  import com.opensymphony.xwork2.ModelDriven;
  
  public class MenuItemAction extends ActionSupport implements ModelDriven&lt;MenuItem&gt;{
  
      private MenuItem menuItem = new MenuItem();
      private final String DATABASE_PROBLEMS = "Error code : Database problems";
      private String json;
  
      public String execute(){
          MenuItemService itemService = new MenuItemService();
          if(itemService.testDatabaseConnectionU()){
          setJson(new Gson().toJson(itemService.getMenuItemsByMenuId(menuItem.getMenuId()) ));
          }else{
              setErrorToBeSentBackToClientSide(DATABASE_PROBLEMS);
          }
          return SUCCESS;
      }
  
      @Override
      public MenuItem getModel() {
          return menuItem;
      }
  
      public String getJson() {
          return json;
      }
  
      public void setJson(String json) {
          this.json = json;
      }
  
      private void setErrorToBeSentBackToClientSide(String error){
  
          String errorCode = error;
          setJson(new Gson().toJson(errorCode));
  
      }
  }
  </code></pre>
  
  <p>And then <code>MenuItem</code> class:</p>
  
  <pre><code>package com.coreRestaurant.menuItem;
  
  public class MenuItem {
  
      private String name;
      private double price;
      private int menuId;
  
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
      public double getPrice() {
          return price;
      }
      public void setPrice(double price) {
          this.price = price;
      }
      public int getMenuId() {
          return menuId;
      }
      public void setMenuId(int menuId) {
          this.menuId = menuId;
      }
      public void setMenuId(MenuItem fromJson) {
          setName(fromJson.getName());
          setPrice(fromJson.getPrice());
  
      }
  }
  </code></pre>
  
  <p>And I am calling those things from PHP file (the two lines do that, but the second one is a worrychild):</p>
  
  <pre><code> $specificMenuJson = file_get_contents('http://localhost:8080/Core/read?id=' . $menuId);
   $specificMenuItemsJson = file_get_contents('http://localhost:8080/Core/readMenuItemById?menuId=' . $menuId);
  </code></pre>
  
  <p>It has problem setting the value of <code>menuId</code>, but I have getters and setters included. I don't know why it sometimes fails to do that. Any suggestions?</p>