# Jena debug meldung



## JenaFreak (9. Sep 2008)

Hi zusammen,

beim simplen Aufruf:


```
<OntModel studiengang = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
```

meldet sich Jena wie siehe unten. Was kann ich tun um das weg zu bekommen?


```
[2008-09-09 16:12:07,187]DEBUG  6125[main] - com.hp.hpl.jena.util.FileManager.addLocator(FileManager.java:147) - Add location: LocatorFile
[2008-09-09 16:12:07,187]DEBUG  6125[main] - com.hp.hpl.jena.util.FileManager.addLocator(FileManager.java:147) - Add location: ClassLoaderLocator
[2008-09-09 16:12:07,187]DEBUG  6125[main] - com.hp.hpl.jena.util.LocationMapper.initFromPath(LocationMapper.java:142) - Failed to find configuration: file:location-mapping.rdf;file:location-mapping.n3;file:location-mapping.ttl;file:etc/location-mapping.rdf;file:etc/location-mapping.n3;file:etc/location-mapping.ttl
[2008-09-09 16:12:07,203]DEBUG  6141[main] - com.hp.hpl.jena.util.FileManager.addLocator(FileManager.java:147) - Add location: LocatorFile
[2008-09-09 16:12:07,203]DEBUG  6141[main] - com.hp.hpl.jena.util.FileManager.addLocator(FileManager.java:147) - Add location: LocatorURL
[2008-09-09 16:12:07,203]DEBUG  6141[main] - com.hp.hpl.jena.util.FileManager.addLocator(FileManager.java:147) - Add location: ClassLoaderLocator
[2008-09-09 16:12:07,203]DEBUG  6141[main] - com.hp.hpl.jena.util.FileManager.addLocator(FileManager.java:147) - Add location: LocatorFile
[2008-09-09 16:12:07,203]DEBUG  6141[main] - com.hp.hpl.jena.util.FileManager.addLocator(FileManager.java:147) - Add location: LocatorURL
[2008-09-09 16:12:07,203]DEBUG  6141[main] - com.hp.hpl.jena.util.FileManager.addLocator(FileManager.java:147) - Add location: ClassLoaderLocator
[2008-09-09 16:12:07,203]DEBUG  6141[main] - com.hp.hpl.jena.util.FileManager.openNoMapOrNull(FileManager.java:518) - Found: file:etc/ont-policy.rdf (ClassLoaderLocator)
```


----------



## ARadauer (9. Sep 2008)

hast du irgendwo eine log4j configuration, wenn ja dan zeig mal...


----------



## Guest (9. Sep 2008)

Ja, bin mir aber grad nicht 100% sicher ob die auch genutzt wird. Hab ich im lib Verzeichnis gefunden 


```
log4j.rootLogger=INFO, stderr

# Set up logging to include a file record of the output
# Note: the file is always created, even if there is 
# no actual output.
# log4j.rootLogger=INFO, stderr, R

# Base of all Jena classes
log4j.logger.com.hp.hpl.jena=INFO,stderr


# Example of switching on debug level logging for part of tree
# log4j.logger.com.hp.hpl.jena.graph.test=debug
# log4j.logger.com.hp.hpl.jena.reasoner=debug
# log4j.logger.com.hp.hpl.jena.reasoner.test=debug

# Log format to standard out
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

# Log format to standard error
log4j.appender.stderr=org.apache.log4j.ConsoleAppender
log4j.appender.stderr.target=System.err
log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stderr.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

# File based log output
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=jena2.log
log4j.appender.R.MaxFileSize=5000KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
```


----------



## Guest (9. Sep 2008)

Das meldet Protege beim Einlesen der fertigen .owl Datei:

WARNING: [Repository Manager] Could not find repository file: file:/C:/testJS2.repository -- RepositoryFileManager.loadRepositoriesFromURI()

Hier die Datei:

```
<rdf:RDF
    xmlns:js="http://www-is.informatik.uni-oldenburg.de/eustel/js.owl#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:daml="http://www.daml.org/2001/03/daml+oil#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:cmo="http://www-is.informatik.uni-oldenburg.de/eustel/cmo.owl#" > 
  <rdf:Description rdf:about="http://www-is.informatik.uni-oldenburg.de/eustel/js.owl#process_1">
    <rdf:type rdf:resource="http://www-is.informatik.uni-oldenburg.de/eustel/cmo.owl#Process"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://www-is.informatik.uni-oldenburg.de/eustel/js.owl#process_step2">
    <rdf:type rdf:resource="http://www-is.informatik.uni-oldenburg.de/eustel/cmo.owl#Process_Step"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://www-is.informatik.uni-oldenburg.de/eustel/js.owl#process_step1">
    <rdf:type rdf:resource="http://www-is.informatik.uni-oldenburg.de/eustel/cmo.owl#Process_Step"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://www-is.informatik.uni-oldenburg.de/eustel/js.owl">
    <owl:imports rdf:resource="http://www-is.informatik.uni-oldenburg.de/eustel/cmo.owl"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Ontology"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://www-is.informatik.uni-oldenburg.de/eustel/js.owl#pppp">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
  </rdf:Description>
</rdf:RDF>
```


----------



## ARadauer (9. Sep 2008)

```
log4j.logger.com.hp.hpl.jena=INFO,stderr
```
änder das mal in

```
log4j.logger.com.hp.hpl.jena=WARN,stderr
```
müsste helfen... ich bin aber auch nicht so der log4j guru


oder

log4j.rootLogger=INFO, stderr 
in..

log4j.rootLogger=WARN, stderr


----------



## Guest (9. Sep 2008)

ähm, mit wegbekommen meinte ich eher wie löse ich das Problem.
Ich möchte also verstehen warum das gemeldet wird und was ich mit dem FileManager machen muss, damit das "weggeht"...


----------



## Guest (9. Sep 2008)

Hab die richtige config nun gefunden:


```
# HOW TO USE LOG4J WITHIN ECLIPSE IN 10 MINUTES
# by Daniel Gonzalez Gasull  gasull[at]gmail[dot]com
#
# 1) Download log4j [url]http://logging.apache.org/site/binindex.cgi[/url]
# 2) Unpack the .zip file in your Java folder (In Windows it is usually 
# C:\Program Files\Java\)
# 3) In Eclipse: Window - Preferences... - Java - Build Path - User Libraries - 
# New - write "log4j" - OK - Add JARs... - navigate to find your log4j .jar you just
# unpacked in the Java Folder - OK 
# 4) right click on your project in the Package Explorer - New - Folder - 
# in "Folder name" write "log4j" - click Advanced - select "Link to a folder in the
# file system" - create a new folder "log4j" in your project folder in the file system
# 5) Place this file you are reading right now in in the folder you just created.  Name
# the file as log4j.properties
# 6) In Eclipse: Run - Run... - In the navigation bar on the left select either the 
# server, or the runnable class, or the JUnit test you want to log with log4j -
# select the Classpath tab - User Entries - Advanced... - Add folders - OK - select 
# the "log4j" folder you created in your project - OK   
# 7) Repeat step 6 for other servers, runnable classes or JUnit tests you want to log
# 8) Change in the following line the "org.example.foo.bar" with whatever you want.
log4j.category.de.scheffler.cpeditor.ApplicationWorkbenchWindowAdvisor=DEBUG
# 9) Add the following import to the Java Class you want to log:
#	import org.apache.log4j.Logger;
# 10) Add this lines to the Java Class you want to log:
#	/**
#	 * Log4j logger
#	 */
#	static Logger log4j = Logger.getLogger("org.example.foo.bar");
# 11) Substitute in the code above "org.example.foo.bar" with whatever your wrote in
# in the step 8.
# 12) Add something like the following code in your Class whenever you want to log:
#	log4j.debug("WTF?");
# 13) Repeat steps 9, 10, 11 and 12 for every Java Class you want to log
# 14) Enjoy!


log4j.rootCategory=DEBUG, R, O

# Stdout
log4j.appender.O=org.apache.log4j.ConsoleAppender

# File
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=log4j.log

# Control the maximum log file size
log4j.appender.R.MaxFileSize=1000KB

# Archive log files (one backup file here)
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.O.layout=org.apache.log4j.PatternLayout

log4j.appender.R.layout.ConversionPattern=[%d{ISO8601}]%5p%6.6r[%t]%x - %C.%M(%F:%L) - %m%n
log4j.appender.O.layout.ConversionPattern=[%d{ISO8601}]%5p%6.6r[%t]%x - %C.%M(%F:%L) - %m%n
```


----------

