Log4j problem after freshly installing pyimagej

>>> import imagej
>>> imagej.init()
log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
<net.imagej.ImageJ at 0x2401207bba0 jclass=net/imagej/ImageJ jself=<LocalRef obj=0x10f47f78 at 0x240118badf0>>

Could someone explain this to me in a non convoluted way. I don’t understand much about computers.

Thank you.

This error is thrown when I use the command mentioned in the title. I am on windows10 64 operating system. I’ve activated the imagej environment in anaconda prompt.

>>> import imagej
>>> imagej.init()
log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
May 09, 2019 8:55:18 AM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
<net.imagej.ImageJ at 0x25b6929d780 jclass=net/imagej/ImageJ jself=<LocalRef obj=0x7b007f98 at 0x25b69b97df0>>

@IETSilencer Thank you for posting here, and very sorry for the long delay in reply. I had not noticed this topic till now. Please feel free to ping me in Gitter with links to unanswered forum topics, if no one answers within a day or two.

There are two different things being discussed here:

This is an issue with the Java-side logging. It boils down to a bug in imagej.init(). I’m sorry about that. Internally, Python is loading the Java library net.imagej:imagej and that does not include a log4j logging implementation on the classpath. I filed an issue as a reminder to fix this. Meanwhile, you can safely ignore the message.

This is a Java bug on Windows, fixed in Java 9. But we are stuck on Java 8 for now. See this SO post for how to work around, if it bothers you.

1 Like