title: JAVA FXCollections LoadException Class is not a valid type
body: <p>I'm trying to implement a TableView with some data with the help of this <a href="https://docs.oracle.com/javafx/2/fxml_get_started/fxml_tutorial_intermediate.htm#CIAHGCEG" rel="noreferrer">Tutorial</a>.</p>
  
  <p>Im stuck on populating data from my "Person.java" to the TableView.</p>
  
  <p>I tracked the problem down to the part <code>&lt;Person firstName="Jacob" lastName="Smith" email="jacob.smith@example.com" /&gt;</code> inside the "fxmltableview.fxml" file at the very bottom.</p>
  
  <p>So it seems that for some reason my "observableArrayList" isn't allwed to contain "Person.java" objects. "String.java" is allowed.
  Im out of ideas for experementing with the files, as i read several times word by word through the tutorial and i don't see any difference between my files. Whenever i remove the <code>&lt;Person someStuff/&gt;</code> it works fine.</p>
  
  <p>How can i get rid of this annoying error?</p>
  
  <p>Caused by: javafx.fxml.LoadException: Person is not a valid type.
  /D:/workspace/TableViewExampleFXML/bin/application/fxmltableview.fxml:40</p>
  
  <p>FXML-File:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import fxmltableview.*?&gt;
  
  &lt;?import javafx.scene.control.TableView?&gt;
  &lt;?import javafx.scene.control.TableColumn?&gt;
  &lt;?import javafx.scene.control.cell.PropertyValueFactory?&gt;
  
  &lt;?import javafx.scene.layout.GridPane?&gt;
  
  &lt;?import javafx.collections.FXCollections?&gt;
  
  
  &lt;GridPane alignment="CENTER" hgap="10.0" maxHeight="-Infinity"
      maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
      prefHeight="400.0" prefWidth="600.0" vgap="10.0" xmlns="http://javafx.com/javafx/8"
      xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.FXMLTableViewController"&gt;
  
      &lt;TableView fx:id="tableView" prefHeight="200.0" prefWidth="200.0"
          GridPane.columnIndex="0" GridPane.rowIndex="1"&gt;
          &lt;columns&gt;
              &lt;TableColumn prefWidth="75.0" text="First Name"&gt;
                  &lt;cellValueFactory&gt;
                      &lt;PropertyValueFactory property="firstName" /&gt;
                  &lt;/cellValueFactory&gt;
              &lt;/TableColumn&gt;
              &lt;TableColumn prefWidth="75.0" text="Last Name"&gt;
                  &lt;cellValueFactory&gt;
                      &lt;PropertyValueFactory property="lastName" /&gt;
                  &lt;/cellValueFactory&gt;
              &lt;/TableColumn&gt;
              &lt;TableColumn prefWidth="75.0" text="Email Address"&gt;
                  &lt;cellValueFactory&gt;
                      &lt;PropertyValueFactory property="email" /&gt;
                  &lt;/cellValueFactory&gt;
              &lt;/TableColumn&gt;
          &lt;/columns&gt;
          &lt;items&gt;
              &lt;FXCollections fx:factory="observableArrayList"&gt;
                  &lt;Person firstName="Jacob" lastName="Smith" email="jacob.smith@example.com" /&gt;
              &lt;/FXCollections&gt;
          &lt;/items&gt;
      &lt;/TableView&gt;
  &lt;/GridPane&gt;
  </code></pre>
  
  <p>The "Person.java" is copy/pasted from the tutorial thats why im so frustrated that it doesn't work for me. Anyway i will paste it here.</p>
  
  <pre><code>package application;
  
  import javafx.beans.property.SimpleStringProperty;
  
  public class Person {
    private final SimpleStringProperty firstName = new SimpleStringProperty("");
    private final SimpleStringProperty lastName = new SimpleStringProperty("");
    private final SimpleStringProperty email = new SimpleStringProperty("");
  
    public Person() {
      this("", "", "");
    }
  
    public Person(String firstName, String lastName, String email) {
      setFirstName(firstName);
      setLastName(lastName);
      setEmail(email);
    }
  
    public String getFirstName() {
      return firstName.get();
    }
  
    public void setFirstName(String fName) {
      firstName.set(fName);
    }
  
    public String getLastName() {
      return lastName.get();
    }
  
    public void setLastName(String fName) {
      lastName.set(fName);
    }
  
    public String getEmail() {
      return email.get();
    }
  
    public void setEmail(String fName) {
      email.set(fName);
    }
  }
  </code></pre>