Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8124196

FXML: forget namespace throw NullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 7u6
    • javafx
    • OsX 10.7

      In a little piece of include fxml, I get a NullPointerException.

      Here is the fxml (include in another fxml)

      <TableView fx:id="stocksList" >
      <columns>
      <TableColumn text="Titre" prefWidth="125">
      <cellValueFactory>
      <PropertyValueFactory property="test" />
      </cellValueFactory>
      </TableColumn>
      </columns>
      </TableView>

      I forgot the namespace xmlns:fx="http://javafx.com/fxml" and I get this error:

      Caused by: java.lang.NullPointerException
      at javafx.fxml.FXMLLoader.logException(FXMLLoader.java:2211)
      at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2030)
      at javafx.fxml.FXMLLoader$IncludeElement.constructValue(FXMLLoader.java:936)
      at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:565)
      at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2314)
      at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2131)

      The exception gives no direction about the problem and it's very difficult to find what is wrong.
      Maybe this problem must be check before.

            mkubec Milan Kubec
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: