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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: 7u6
    • Component/s: javafx
    • Environment:

      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

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

                Created:
                Updated:
                Resolved:
                Imported: