java.lang.NoClassDefFoundError: javax/mail/Authenticator - causing fxml page not to load

时间:2016-04-21 22:31:03

标签: java eclipse maven tableview fxml

I am restructuring this question - edited from another question.

When I do log in to the program and double click on an item in the tableView I am not getting anything at all on the new tab that is supposed to pop up. The Main.fxml shows fine, meaning that the MainController seems to be working well, Image:

enter image description here

When you double click on a row it should look like:

enter image description here

But this is happening:

enter image description here

To show you how the code is called, which works great in the .java form, but when it is compiled it breaks:

Tab tab = new Tab();
    tabs.getTabs().add(tab);
    tab.setText(tableView.getSelectionModel().getSelectedItem().getDescription());
    // loads the previously instantiated version of the Item.fxml resource
    FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource("fxml/Item.fxml"));
    tab.setContent((Node) loader.load());

    date = dateLbl.getText();
    time = timeLbl.getText();
    user = userLbl.getText();

    SingleSelectionModel<Tab> selectionModel = tabs.getSelectionModel();
    selectionModel.select(tab);
    // creates an ItemController object and passes through the results of the database query and stores them as variables in the ItemController, also sets the database to aseptic
    ItemController controller = loader.<ItemController>getController();
    controller.setTextItems(id, manufacturer_name, model_number, vendor_name, vendor_part_number, tolmar_part_number, part_location, price, quantity, min, max, img, equipment_group, equipment_id, additional_notes, description);
    controller.setUserVariables(user, time, date);
    controller.setDBState(aseptic);

As you can see in the bottom right corner of the second image (the way the program should open when I double click a row), I can add or remove items. When this item hits its minimum it auto generates an email letting me know how many more I need to order. I believe this functionality is not working properly and possibly causing the whole page not to load? I have reviewed others similar questions and have tried what was suggested to no luck, i added a mail.jar and activation.jar files and added them to my pom as well (see below). I feel like I am getting pretty close to getting this code to actually work in the real world, please help, thanks!

<dependency>
    <groupId>javax.mail</groupId>
    <artifactId>mail</artifactId>
    <version>1.4</version>
</dependency>
<dependency>
    <groupId>javax.activation</groupId>
    <artifactId>activation</artifactId>
    <version>1.1</version>
</dependency>

1 个答案:

答案 0 :(得分:0)

现在它正常工作,我将javax.mail依赖的版本从1.4改为1.4.1,这很好。