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

NullPointerException when using fx:include

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 7u40
    • 8
    • javafx
    • Mac OS 10.8.4 (Retina)
      JDK 1.7.0_u40 ea b38

    Description

      FXMLLoader fails to load a sub layout using fx:include.

      Here is the parent.fxml:

      <AnchorPane xmlns:fx="http://javafx.com/fxml">
        <children>
          <fx:include source="/include.fxml"/>
        </children>
      </AnchorPane>

      Here is the include.fxml (empty pane):

      <AnchorPane xmlns:fx="http://javafx.com/fxml">
      </AnchorPane>

      At runtime I get the following stacktrace:

      Caused by: java.lang.NullPointerException
      at javafx.fxml.FXMLLoader.equals(FXMLLoader.java:1855)
      at javafx.fxml.FXMLLoader.isCyclic(FXMLLoader.java:1867)
      at javafx.fxml.FXMLLoader.access$2200(FXMLLoader.java:66)
      at javafx.fxml.FXMLLoader$IncludeElement.constructValue(FXMLLoader.java:935)
      at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:565)
      at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2348)
      at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2164)

      Attachments

        Activity

          People

            msladecek Martin Sládeček
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: