java - Why do I get a log4j:WARN message when loading a .owl file with Jena Ontology API? -


i'm new concepts ontology , inferencing. have ontology saved in .owl format. target load .owl file using jena api in netbeans 7.4, inference grab required information ontology. followed documentation given in jena site(https://jena.apache.org/documentation/ontology ). far tried load .owl file netbeans using following code set.

string path = "c:/datafiles/wine.owl"; model model = filemanager.get().loadmodel("file:" + path); reasoner reasoner = reasonerregistry.getowlreasoner(); infmodel infmodel = modelfactory.createinfmodel(reasoner, model); 

but error.

log4j:warn no appenders found logger  (org.apache.jena.riot.stream.jenaioenvironment). log4j:warn please initialize log4j system properly. log4j:warn see http://logging.apache.org/log4j/1.2/faq.html#noconfig more info. 

how fix this?

jena uses log4j logging. message says need initialize log4j properly. have followed link in message?

if don't initialize log4j, miss out on logging program should still run. can initialize log4j either

a)
providing configuration file called log4j.properties. if use maven or maven-like project structure put in src/java/resources/ , log4j pick up. contents of file should like

log4j.rootlogger=info, stdlog log4j.appender.stdlog=org.apache.log4j.consoleappender log4j.appender.stdlog.layout=org.apache.log4j.patternlayout log4j.appender.stdlog.layout.conversionpattern=%d{hh:mm:ss,sss} - %c{1}:%l - %m%n` 

follow link in message , learn log4j can put config file fits needs.

or

b)
calling logctl.setcmdlogging(); in code use configuration jena uses command line (which may or may not purposes). f.i. can put in static {} code block in main class.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -