log4j: WARN No appenders could be found for logger (net.didion.jwnl.dictionary.Dictionary)

345 views
Skip to first unread message

Paul McQuesten

unread,
Mar 11, 2011, 6:32:47 PM3/11/11
to link-grammar
Am I supposed to make a log4j configuration file, or is this message a
symptom of a bad install? Any clues will be appreciated. I think this
output means that most of my paths are set correctly???
-----------------------
relex> ./batch-process.sh
Info: Using file defined in wordnet.configfile:data/wordnet/
file_properties.xml
log4j:WARN No appenders could be found for logger
(net.didion.jwnl.dictionary.Dictionary).
log4j:WARN Please initialize the log4j system properly.
<?xml version="1.0" encoding="UTF-8"?>
<nlparse xmlns="http://opencog.org/RelEx/0.1.1">
<parser>link-grammar-4.7.4 relex-1.4.0</parser>
<date>2011-03-11 14:32:02 -0800</date>

link-grammar: Info: Dictionary found at /usr/local/share/link-grammar/
en/4.0.dict
link-grammar: Info: JNI: dictionary version 4.7.4
Link-parsing: 1344 milliseconds (avg=1344 millisecs, cnt=1)
RelEx processing: 512 milliseconds (avg=512 millisecs, cnt=1)
<sentence index="1" parses="1">
<...snip...>
</nlparse>

Linas Vepstas

unread,
Mar 13, 2011, 9:19:47 PM3/13/11
to link-g...@googlegroups.com, Paul McQuesten
On 11 March 2011 17:32, Paul McQuesten <mcqu...@gmail.com> wrote:
> Am I supposed to make a log4j configuration file, or is this message a
> symptom of a bad install? Any clues will be appreciated. I think this
> output means that most of my paths are set correctly???
> -----------------------
> relex> ./batch-process.sh
> Info: Using file defined in wordnet.configfile:data/wordnet/
> file_properties.xml
> log4j:WARN No appenders could be found for logger
> (net.didion.jwnl.dictionary.Dictionary).
> log4j:WARN Please initialize the log4j system properly.

I've never seen this message before.

Given that the rest of the parse below seems to have gone just
fine, I guess things are working OK & I guess its OK to ignore
the message.

FWIW, I installed log4j as part of my distro (apt-get log4j-whatever...)
and so I assume the install script took care of that initialization.
My guess is that you copied log4j.jar from somewhere and skipped one
of the install steps ... if you're on redhat or debian or ubuntu, try using
apt-get or yum, etc.

--linas

Paul McQuesten

unread,
Mar 18, 2011, 4:31:35 PM3/18/11
to link-grammar
SOLVED: Added 'log4j.properties' file to 'bin' subdirectory of relex,
see [code] below.

CAUSE: Need to have 'log4j.xml' or 'log4j.properties' in -classpath.

CLUE: Add '-Dlog4j.debug=true' to the 'java' invocation in 'relation-
extractor.sh', which then said:
[quote]
log4j: Trying to find [log4j.xml] using context classloader
sun.misc.Launcher$AppClassLoader@35a16869.
log4j: Trying to find [log4j.xml] using sun.misc.Launcher
$AppClassLoader@35a16869 class loader.
log4j: Trying to find [log4j.xml] using
ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader
sun.misc.Launcher$AppClassLoader@35a16869.
log4j: Trying to find [log4j.properties] using sun.misc.Launcher
$AppClassLoader@35a16869 class loader.
log4j: Trying to find [log4j.properties] using
ClassLoader.getSystemResource().
log4j: Could not find resource: [null].
[/quote]

As Linas suspected, I must have installed something manually, although
I usually do try to use synaptic (Ubuntu 10.04 Lucid, kernel 2.6.32-29-
generic #58 Ubuntu SMP x86_64). At least I have a prior install of
WordNet, which I do not want to blow away because it is used by
applications I installed before RelEx.

Further, both 'openjdk-6' and 'sun-java6' are installed on my system
(not to mention 'gcj-4.4'), with the 'sun' flavor selected in /etc/
alternatives. According to 'http://wiki.opencog.org/w/
RelEx#Relex_Standalone_Installation_Procedure_(without_Opencog)'
openjdk is preferred, but I do not know how much damage that would do
to me.

<rant>The existence of two Java systems is antithetical to the "write
once, run anywhere" mantra. Someone should be shot, or at least
defenestrated.</rant>

If some kind soul using ReLex would post the result of 'locate
log4j.properties' I would be most appreciative. The standard contents
would be nice, too.

As frustrating as this exercise was, it brought me to the realization
that it is absolutely astounding that something with as many moving
parts as RelEx can be made to work at all. Thanks, Linas.

// ------------------------------------------------------------------
Here is the contents of a 'log4j.properties' file that works:
[code]
# simple log4j properties / configuration file
# after http://www.devdaily.com/blog/post/java/simple-log4j-example
log4j.appender.Stdout=org.apache.log4j.ConsoleAppender
log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.Stdout.layout.ConversionPattern=%d %p [%t] %C{1} - %m\n
log4j.rootLogger=INFO,Stdout
[/code]
Reply all
Reply to author
Forward
0 new messages