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

FXMLLoader: IllegalAccessException when Initializable not implemented and initialize() is present but not public

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 7u6
    • javafx
    • Win64, JRE6 64bit, FX 2.2

        A legacy super class for my FXML controller already includes a protected initialize() method. The controller does not implement the Initializable interface. Consequently, FXMLLoader tries to call the no-args initialize() method and fails with IllegalAccessException:

        Caused by: javafx.fxml.LoadException: java.lang.IllegalAccessException: Class javafx.fxml.FXMLLoader can not access a member of class mint.panel.MintContextPanel with modifiers "protected"
        at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2184)
        at mint.javafx.MintFXUtils.loadWithController(MintFXUtils.java:86)
        ... 8 more
        Caused by: java.lang.IllegalAccessException: Class javafx.fxml.FXMLLoader can not access a member of class mint.panel.MintContextPanel with modifiers "protected"
        at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2182)
        ... 9 more

              gkbrown Greg Brown (Inactive)
              wlehmann Werner Lehmann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported: