SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

Jake
Hello, i just happen to a problem.  The program appears error like this.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

this is the code as the following:

import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.reasoner.OWLReasoner;
import org.swrlapi.exceptions.SWRLRuleEngineException;
import org.swrlapi.factory.SWRLAPIFactory;
import org.swrlapi.parser.SWRLParseException;
import org.swrlapi.sqwrl.SQWRLQueryEngine;
import org.swrlapi.sqwrl.SQWRLResult;
import org.swrlapi.sqwrl.exceptions.SQWRLException;

public class test {
        public static OWLOntologyManager manager;
        public static OWLOntology ontology;
        public static OWLReasoner reasoner;


        public static void main(String[] args) {
                try {
// System.out.println("=================");
                        manager = OWLManager.createOWLOntologyManager();
                        ontology = manager.loadOntology(IRI.create("file:/d:/animal.owl"));
                        SQWRLQueryEngine queryEngine = SWRLAPIFactory
                                        .createSQWRLQueryEngine(ontology);

                        SQWRLResult result = queryEngine.runSQWRLQuery("Q1",
                                        "Animal(?a)  -> sqwrl:select(?a)");

// System.out.println("----------------------------------");
                        while (result.next()) {
                                System.out.println(result.getColumnNames());
                               
                               
                                System.out.println("Name: "
                                                + result.getLiteral("name").getString());
                                System.out.println("Salary: "
                                                + result.getLiteral("salary").getInt());
                        }
                } catch (SWRLRuleEngineException | SQWRLException | SWRLParseException
                                | OWLOntologyCreationException e) {
                        e.printStackTrace();
                }

        }

}


could you tell me why?thank you very much!
Reply | Threaded
Open this post in threaded view
|

Re: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

Matthew Horridge-2
Administrator
Hi,

How are you building and running this?

You get the warning because you don’t have an SLF4J logging implementation on your class path.  See this link for more information:


Cheers,

Matthew




On 7 Dec 2015, at 00:25, Jake <[hidden email]> wrote:

Hello, i just happen to a problem.  The program appears error like this.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.

this is the code as the following:

import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.reasoner.OWLReasoner;
import org.swrlapi.exceptions.SWRLRuleEngineException;
import org.swrlapi.factory.SWRLAPIFactory;
import org.swrlapi.parser.SWRLParseException;
import org.swrlapi.sqwrl.SQWRLQueryEngine;
import org.swrlapi.sqwrl.SQWRLResult;
import org.swrlapi.sqwrl.exceptions.SQWRLException;

public class test {
public static OWLOntologyManager manager;
public static OWLOntology ontology;
public static OWLReasoner reasoner;


public static void main(String[] args) {
try {
// System.out.println("=================");
manager = OWLManager.createOWLOntologyManager();
ontology = manager.loadOntology(IRI.create("file:/d:/animal.owl"));
SQWRLQueryEngine queryEngine = SWRLAPIFactory
.createSQWRLQueryEngine(ontology);

SQWRLResult result = queryEngine.runSQWRLQuery("Q1",
"Animal(?a)  -> sqwrl:select(?a)");

// System.out.println("----------------------------------");
while (result.next()) {
System.out.println(result.getColumnNames());


System.out.println("Name: "
+ result.getLiteral("name").getString());
System.out.println("Salary: "
+ result.getLiteral("salary").getInt());
}
} catch (SWRLRuleEngineException | SQWRLException | SWRLParseException
| OWLOntologyCreationException e) {
e.printStackTrace();
}

}

}


could you tell me why?thank you very much!



--
View this message in context: http://protege-project.136.n4.nabble.com/SLF4J-Failed-to-load-class-org-slf4j-impl-StaticLoggerBinder-tp4664113.html
Sent from the Protege Developer mailing list archive at Nabble.com.
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

Jake
Thank you very much, Matthew. The jars are about log file administration. I have get them with your instruction.