Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

log4j.Logger fails to initialize LogManager  RSS feed

S McCormick
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all. I have a Java batch process that is trying to write to the Log4j log file, but it appears that the Logger class is failing to initialize the LogManager class.

Am I understanding this issue correctly? Any idea what would cause this? I have verified that the log4j.jar file is in the .\lib directory.

Any help would be appreciated!



"Using java version:"

C:\sls>C:\bea103\jdk160_05\bin\java.exe -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)

"Calling StoreLaborSystem Batch - TLGIntegrationGUI"
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.LogManager
at org.apache.log4j.Logger.getLogger(
at com.wendys.common.logging.Logger.getLogger(
at com.wendys.common.logging.Logger.canLog(
at com.wendys.common.logging.Logger.canLogDebug(
at com.wendys.tlg.TLGIntegration.main(
at com.wendys.tlg.TLGIntegrationGUI.startLaborGuide(
at com.wendys.tlg.TLGIntegrationGUI.actionPerformed(
at javax.swing.AbstractButton.fireActionPerformed(
at javax.swing.AbstractButton$Handler.actionPerformed(
at javax.swing.DefaultButtonModel.fireActionPerformed(
at javax.swing.DefaultButtonModel.setPressed(
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(
at java.awt.Component.processMouseEvent(
at javax.swing.JComponent.processMouseEvent(
at java.awt.Component.processEvent(
at java.awt.Container.processEvent(
at java.awt.Component.dispatchEventImpl(
at java.awt.Container.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.LightweightDispatcher.retargetMouseEvent(
at java.awt.LightweightDispatcher.processMouseEvent(
at java.awt.LightweightDispatcher.dispatchEvent(
at java.awt.Container.dispatchEventImpl(
at java.awt.Window.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(
at java.awt.EventDispatchThread.pumpEventsForFilter(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(
Henrique Ordine
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi McCormick,

Did you ever manage to solve your problem? I'm getting the same error.

It seems that at runtime some class can't be found (hence the message NoClassDefFoundError) but the name of that class gets lost along the Exception Handling process.

In my classpath, both LogManager and Logger exist.

It's funny that the code seems to fail inside my ThinMPI class, where I do this:

Can anyone help?
shah khairudin
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Henrique,

i'm getting the same problem too

"java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.LogManager"

i've put the log4j.jar inside lib folder but the problem still there.

any idea?

Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!