title: JavaFX PropertyValueFactory is not able to retrieve property
body: <h2>Summary:</h2>
  
  <p>I am trying to add/reload data from an ArrayList to a TableView by pressing a "Reload Button" (currently I am just testing it with one column of the TableView) . 
  Because TableView requires an ObservableList, I made an ObservableList getter method where the ObservableList is created from an existing ArrayList (I tested both Lists by printing their values with no issue). Everytime I press the reload button,only the amount of rows are created and I get an error, caused by this line of code:</p>
  
  <pre class="lang-java prettyprint-override"><code>columnProject.setCellValueFactory(new PropertyValueFactory&lt;Bill, String&gt;("project"));
  </code></pre>
  
  <p>I looked the problem up for the last 3 hours and tried everything I found on Stack Overflow without any success.</p>
  
  <h2>Information:</h2>
  
  <ul>
  <li>Java: openjdk 11.0.3 and Javafx-11</li>
  <li>Operating System: Manjaro Linux with Kernel 5.0.7-1</li>
  <li>IDE: IntelliJ Idea Ultimate 2019</li>
  <li>I use FXML with SceneBuilder for all JavaFX Objects</li>
  </ul>
  
  <h2>Error:</h2>
  
  <pre><code>Apr 26, 2019 10:23:16 PM javafx.scene.control.cell.PropertyValueFactory getCellDataReflectively
  WARNING: Can not retrieve property 'project' in PropertyValueFactory: javafx.scene.control.cell.PropertyValueFactory@688d477d with provided class type: class net.strobl.main.Bill
  java.lang.RuntimeException: java.lang.ClassCastException: class java.lang.String cannot be cast to class javafx.beans.property.ReadOnlyProperty (java.lang.String is in module java.base of loader 'bootstrap'; javafx.beans.property.ReadOnlyProperty is in module javafx.base of loader 'app')
      at javafx.base/com.sun.javafx.property.PropertyReference.getProperty(PropertyReference.java:199)
      at javafx.controls/javafx.scene.control.cell.PropertyValueFactory.getCellDataReflectively(PropertyValueFactory.java:182)
      at javafx.controls/javafx.scene.control.cell.PropertyValueFactory.call(PropertyValueFactory.java:154)
      at javafx.controls/javafx.scene.control.cell.PropertyValueFactory.call(PropertyValueFactory.java:133)
      at javafx.controls/javafx.scene.control.TableColumn.getCellObservableValue(TableColumn.java:593)
      at javafx.controls/javafx.scene.control.TableColumn.getCellObservableValue(TableColumn.java:578)
      at javafx.controls/javafx.scene.control.TableCell.updateItem(TableCell.java:646)
      at javafx.controls/javafx.scene.control.TableCell.indexChanged(TableCell.java:469)
      at javafx.controls/javafx.scene.control.IndexedCell.updateIndex(IndexedCell.java:120)
      at javafx.controls/javafx.scene.control.skin.TableRowSkinBase.updateCells(TableRowSkinBase.java:539)
      at javafx.controls/javafx.scene.control.skin.TableRowSkinBase.&lt;init&gt;(TableRowSkinBase.java:159)
      at javafx.controls/javafx.scene.control.skin.TableRowSkin.&lt;init&gt;(TableRowSkin.java:89)
      at javafx.controls/javafx.scene.control.TableRow.createDefaultSkin(TableRow.java:213)
      at javafx.controls/javafx.scene.control.Control.doProcessCSS(Control.java:897)
      at javafx.controls/javafx.scene.control.Control.access$000(Control.java:83)
      at javafx.controls/javafx.scene.control.Control$1.doProcessCSS(Control.java:89)
      at javafx.controls/com.sun.javafx.scene.control.ControlHelper.processCSSImpl(ControlHelper.java:67)
      at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145)
      at javafx.graphics/javafx.scene.Node.processCSS(Node.java:9529)
      at javafx.graphics/javafx.scene.Node.applyCss(Node.java:9616)
      at javafx.controls/javafx.scene.control.skin.VirtualFlow.setCellIndex(VirtualFlow.java:1715)
      at javafx.controls/javafx.scene.control.skin.VirtualFlow.getCell(VirtualFlow.java:1692)
      at javafx.controls/javafx.scene.control.skin.VirtualFlow.getCellLength(VirtualFlow.java:1801)
      at javafx.controls/javafx.scene.control.skin.VirtualFlow.computeViewportOffset(VirtualFlow.java:2639)
      at javafx.controls/javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1245)
      at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1204)
      at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211)
      at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211)
      at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211)
      at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211)
      at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1211)
      at javafx.graphics/javafx.scene.Scene.doLayoutPass(Scene.java:576)
      at javafx.graphics/javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2482)
      at javafx.graphics/com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Toolkit.java:412)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at javafx.graphics/com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:411)
      at javafx.graphics/com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:438)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:519)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:499)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:492)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:320)
      at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
      at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
      at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
      at java.base/java.lang.Thread.run(Thread.java:834)
  Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class javafx.beans.property.ReadOnlyProperty (java.lang.String is in module java.base of loader 'bootstrap'; javafx.beans.property.ReadOnlyProperty is in module javafx.base of loader 'app')
      at javafx.base/com.sun.javafx.property.PropertyReference.getProperty(PropertyReference.java:197)
      ... 44 more
  </code></pre>
  
  <h2>Code:</h2>
  
  <p>Note: I deleted some methods here which are irrelevant to this problem for better readability</p>
  
  <p>Bill Class:</p>
  
  <pre class="lang-java prettyprint-override"><code>package net.strobl.main;
  
  public class Bill {
  
      private String project;
      private boolean intake;
      private Double amount;
      private boolean digital;
      private String date1;
      private String date2;
      private String date3;
      private String shop;
      private String reason;
      private String person;
      private boolean paid;
  
      public Bill(String project, boolean intake, Double amount, boolean digital, String date1, String date2, String date3, String shop, String reason, String person, boolean paid) {
          this.project = project;
          this.intake = intake;
          this.amount = amount;
          this.digital = digital;
          this.date1 = date1;
          this.date2 = date2;
          this.date3 = date3;
          this.shop = shop;
          this.reason = reason;
          this.person = person;
          this.paid = paid;
      }
  
      //region Getters and Setters
      public String getProject() {
          return project;
      }
  
      public String projectProperty() {
          return project;
      }
  
      public void setProject(String project) {
          this.project = project;
      }
  
      public boolean isIntake() {
          return intake;
      }
  
      public void setIntake(boolean intake) {
          this.intake = intake;
      }
  
      public Double getAmount() {
          return amount;
      }
  
      public void setAmount(Double amount) {
          this.amount = amount;
      }
  
      public boolean isDigital() {
          return digital;
      }
  
      public void setDigital(boolean digital) {
          this.digital = digital;
      }
  
      public String getDate1() {
          return date1;
      }
  
      public void setDate1(String date1) {
          this.date1 = date1;
      }
  
      public String getDate2() {
          return date2;
      }
  
      public void setDate2(String date2) {
          this.date2 = date2;
      }
  
      public String getDate3() {
          return date3;
      }
  
      public void setDate3(String date3) {
          this.date3 = date3;
      }
  
      public String getShop() {
          return shop;
      }
  
      public void setShop(String shop) {
          this.shop = shop;
      }
  
      public String getReason() {
          return reason;
      }
  
      public void setReason(String reason) {
          this.reason = reason;
      }
  
      public String getPerson() {
          return person;
      }
  
      public void setPerson(String person) {
          this.person = person;
      }
  
      public boolean isPaid() {
          return paid;
      }
  
      public void setPaid(boolean paid) {
          this.paid = paid;
      }
      //endregion
  }
  
  </code></pre>
  
  <p>Controller Class:</p>
  
  <pre class="lang-java prettyprint-override"><code>package net.strobl.main;
  
  
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.event.ActionEvent;
  import javafx.fxml.FXML;
  
  import javafx.scene.control.*;
  
  import javafx.scene.control.cell.PropertyValueFactory;
  import net.strobl.processing.DataManager;
  
  import java.io.IOException;
  
  
  public class Controller{
  
      private App app;
      private DataManager dataManager;
  
  
      //region @FXML Objects new Bill
      @FXML
      Button submitButton;
  
      @FXML
      TextField inputProject;
      @FXML
      TextField inputAmount;
      @FXML
      TextField inputShop;
      @FXML
      TextField inputReason;
      @FXML
      TextField inputPerson;
      @FXML
      TextField inputDate1;
      @FXML
      TextField inputDate2;
      @FXML
      TextField inputDate3;
      @FXML
      RadioButton inputIntake;
      @FXML
      RadioButton inputDigital;
      @FXML
      RadioButton inputPaid;
      //endregion
  
      //region @FXML Objects viewProject
      @FXML
      Spinner&lt;String&gt; spinnerProjectSelect;
      @FXML
      TextField textFieldProjectSpent;
      @FXML
      TextField textFieldProjectGained;
      @FXML
      TextField textFieldProjectRevenue;
      @FXML
      ScrollPane scrollPane;
  
      //region @FXML TableView and Columns
      @FXML
      TableView&lt;Bill&gt; tableView;
      @FXML
      TableColumn&lt;Bill, String&gt; columnProject;
      @FXML
      TableColumn&lt;Bill, String&gt; columnAmount;
      @FXML
      TableColumn&lt;Bill, String&gt; columnIntake;
      @FXML
      TableColumn&lt;Bill, String&gt; columnDigital;
      @FXML
      TableColumn&lt;Bill, String&gt; columnShop;
      @FXML
      TableColumn&lt;Bill, String&gt; columnReason;
      @FXML
      TableColumn&lt;Bill, String&gt; columnPerson;
      @FXML
      TableColumn&lt;Bill, String&gt; columnDate1;
      @FXML
      TableColumn&lt;Bill, String&gt; columnDate2;
      @FXML
      TableColumn&lt;Bill, String&gt; columnDate3;
      @FXML
      TableColumn&lt;Bill, String&gt; columnPaid;
  
  
      public void addTableViewData(ActionEvent event){
          columnProject.setCellValueFactory(new PropertyValueFactory&lt;Bill, String&gt;("project"));
          tableView.setItems(getObservableBills());
      }
  
      private ObservableList&lt;Bill&gt; getObservableBills(){
          return FXCollections.observableArrayList(app.getBills());
      }
  
      public Controller() throws IOException {
          app = new App();
          dataManager = new DataManager();
  
      }
  
  }
  
  </code></pre>
  
  <h2>fxml file (only included the button and the TableView):</h2>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import javafx.scene.control.Button?&gt;
  &lt;?import javafx.scene.control.ScrollPane?&gt;
  &lt;?import javafx.scene.control.TableColumn?&gt;
  &lt;?import javafx.scene.control.TableView?&gt;
  
           &lt;TableView fx:id="tableView" prefHeight="585.0" prefWidth="800.0"&gt;
             &lt;columns&gt;
               &lt;TableColumn fx:id="columnProject" prefWidth="94.0" text="Project" /&gt;
               &lt;TableColumn fx:id="columnAmount" prefWidth="66.0" text="Amount" /&gt;
                 &lt;TableColumn fx:id="columnIntake" prefWidth="57.0" text="Intake" /&gt;
                 &lt;TableColumn fx:id="columnDigital" minWidth="0.0" prefWidth="54.0" text="Digital" /&gt;
                 &lt;TableColumn fx:id="columnShop" minWidth="1.0" prefWidth="85.0" text="Shop" /&gt;
                 &lt;TableColumn fx:id="columnReason" prefWidth="86.0" text="Reason" /&gt;
                 &lt;TableColumn fx:id="columnPerson" prefWidth="87.0" text="Person" /&gt;
                 &lt;TableColumn fx:id="columnDate1" prefWidth="74.0" text="Date 1" /&gt;
                 &lt;TableColumn fx:id="columnDate2" prefWidth="64.0" text="Date 2" /&gt;
                 &lt;TableColumn fx:id="columnDate3" prefWidth="64.0" text="Date 3" /&gt;
                 &lt;TableColumn fx:id="columnPaid" prefWidth="68.0" text="Paid" /&gt;
             &lt;/columns&gt;
           &lt;/TableView&gt;
  
  &lt;Button fx:id="buttonReload" mnemonicParsing="false" onAction="#addTableViewData" prefHeight="28.0" prefWidth="140.0" text="Reload" GridPane.rowIndex="2" /&gt;
  </code></pre>
  
  <h2>module-info.java</h2>
  
  <pre class="lang-java prettyprint-override"><code>module AutomatedFinances {
      requires javafx.controls;
      requires javafx.fxml;
      requires opencsv;
  
      opens net.strobl.main;
  }
  </code></pre>