java.lang.module.ResolutionException:

Viewed 3644

I am new here. I would like to get some help. I searched but coudl not find an explanation whz I am getting this error:

Error occurred during initialization of boot layer java.lang.module.ResolutionException: Modules slf4j.log4j12 and log4j export package org.apache.log4j to module org.apache.jena.base

I want to read the rdf file and this I do in a method within a javafx controller.

The contriller is ....

import java.io.File;

import org.apache.jena.rdf.model.Model;
import org.apache.jena.util.FileManager;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.stage.FileChooser;
import javafx.stage.FileChooser.ExtensionFilter;
import javafx.stage.Stage;
....
    @FXML
    private void actionOpenButton(ActionEvent event)
    {
        FileChooser filechooser = new FileChooser();
        filechooser.getExtensionFilters().addAll(new ExtensionFilter("RDF files", "*.rdf"));
        File selectedFile = filechooser.showOpenDialog(null);
        if (selectedFile != null) {
            System.out.println(selectedFile);
            Model model = FileManager.get().loadModel(selectedFile.toString());
            model.write(System.out,"TURTLE");

        } else {
            System.out.println("File is not OK");
        }
    }

in the module-info file I have

    exports application;
    opens application;

    requires javafx.base;
    requires javafx.fxml;
    requires javafx.graphics;
    requires javafx.controls;
    requires javafx.media;
    requires javafx.swing;
    requires javafx.web;
    requires org.apache.jena.core;
    requires org.apache.jena.arq;

All is working well with the GUI. Only when I add the line to read the rdf I get the error I reported. I am doing this in Eclipse and Apache Jena library is added to the project.

Thanks in advance.

0 Answers
Related