0

I have a project that I did in java 1.7. Now I'm in Java 1.8. I have trouble compiling. It starts compiling well, but then brings an error:

file:/D:/standAloneDev/java/workingDir/live/WakiliProject/dist/run1908724736/WakiliProject.jar!/wakiliproject/Home.fxml

Location is not set.
screen hasn't been loaded!!!

The stack-trace

Exception in Application start method
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:367)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:305)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:894)
    at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:56)
    at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:158)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
    at wakiliproject.WakiliProject.start(WakiliProject.java:68)
    at com.sun.javafx.application.LauncherImpl$8.run(LauncherImpl.java:837)
    at com.sun.javafx.application.PlatformImpl$7.run(PlatformImpl.java:335)
    at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:301)
    at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:298)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:298)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
    at com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112)
    ... 1 more
Exception running application wakiliproject.WakiliProject
Java Result: 1
Deleting directory D:\standAloneDev\java\workingDir\live\WakiliProject\dist\run1908724736
jfxsa-run:
BUILD SUCCESSFUL (total time: 34 seconds)

The error is at:

    HomeController.iconifyStageLabel.setOnMousePressed((MouseEvent event) -> {
        primaryStage.setIconified(true);
    });

    HomeController.closeStageLabel.setOnMousePressed((MouseEvent event) -> {
        primaryStage.close();
    });

The rest of the class looks something like:

Please note line: // This is where compilation seems to stop at ... below

public class HomeController implements Initializable, ControlledScreen {

    Agenda lAgenda;
    Pane visibleCenterPane;

    Map<String, Agenda.AppointmentGroup> lAppointmentGroupMap;
    public static boolean currentSessionState = true;

    List countriesTableInitItems = RetrieveInitialDBItems.retrieveCountriesList();

    @FXML
    public static TableView<NewBeautifulKiwiPOJO> KIWI_TABLE;

    @FXML
    public static TableColumn<NewBeautifulKiwiPOJO, Object> KiwiId;

    @FXML
    public static TableColumn<NewBeautifulKiwiPOJO, String> Kiwi;

    @FXML
    public static TableColumn<NewBeautifulKiwiPOJO, Boolean> KiwiAction;

    @FXML
    private TableColumn<NewBeautifulKiwiPOJO, String> selectablesKiwi;

    @FXML
    public static TableView<InitialDBItemsPOJO> COUNTRIES_TABLE;

    @FXML
    private TableColumn<InitialDBItemsPOJO, Integer> countryID;

    @FXML
    private TableColumn<InitialDBItemsPOJO, String> country;

// Settings TableView
    @FXML
    public static TableView<SettingsPOJO> settingsTableView;

    @FXML
    public static TableColumn<SettingsPOJO, Integer> userID;

    @FXML
    public static TableColumn<SettingsPOJO, String> primaryEmail;

    ScreensController myController;

    private IntegerProperty index = new SimpleIntegerProperty();

    // Initializes the controller class.
    @Override
    public void initialize(URL url, ResourceBundle rb) {

        // Set up Tables
        // SettingsTableView.settingsTableView();
        new KiwiTableView().kiwiTableView();

        KIWITextField.addEventFilter(KeyEvent.KEY_TYPED, maxLength(140));
        System.out.println("KIWITextField initialized to check fo count....");

        visibleCenterPane = homeContentDisplay;
        countryID.setCellValueFactory(new PropertyValueFactory<InitialDBItemsPOJO, Integer>("countriesListID"));
        country.setCellValueFactory(new PropertyValueFactory<InitialDBItemsPOJO, String>("countriesList"));
        COUNTRIES_TABLE.setItems((ObservableList<InitialDBItemsPOJO>) countriesTableInitItems);

        // Set the total number of Kiwis posted
        totalKiwiStatus.setText(totalKiwiStatus());

        // This is where compilation seems to stop at

        lAgenda = new Agenda();
        lAgenda.setPrefWidth(498);
        lAgenda.setPrefHeight(191);

        for (CalendarPOJO e : new RetrieveAgenda().RetrieveAgenda()) {
            lAgenda.appointments().add(
                new Agenda.AppointmentImpl()
                .withStartTime(e.getStartTime())
                .withEndTime(e.getEndTime())
                .withSummary(e.getSummury())
                .withDescription(e.getDescription())
                .withAppointmentGroup((new AgendaAppointmentGroups().lAppointmentGroupMap(e.getAppointmentGroup()))));
        }

        // accept new appointments
        lAgenda.createAppointmentCallbackProperty().set(new Callback<Agenda.CalendarRange, Agenda.Appointment>() {
            public Agenda.Appointment call(Agenda.CalendarRange calendarRange) {
                return new Agenda.AppointmentImpl()
                    .withStartTime(calendarRange.getStartCalendar())
                    .withEndTime(calendarRange.getEndCalendar())
                    .withSummary("Add new appointment here")
                    .withDescription("new")
                    .withAppointmentGroup(lAppointmentGroupMap.get("group1"));
            }
        });

        agendaPane.getChildren().add(lAgenda);
    }

    @Override
    public void setScreenParent(ScreensController screenParent) {
        myController = screenParent;
    }
}

What could I be doing wrong? Thank you all.

Program-Me-Rev
  • 6,184
  • 18
  • 58
  • 142
  • Hi @Jigar Joshi. Thanks for the response. How can I fix it? – Program-Me-Rev Jul 11 '14 at 17:38
  • possible duplicate of [javafx 8 compatibility issues - FXML static fields](http://stackoverflow.com/questions/23105433/javafx-8-compatibility-issues-fxml-static-fields) – James_D Jul 11 '14 at 23:22

0 Answers0