当前位置: 动力学知识库 > 问答 > 编程问答 >

java.lang.NoClassDefFoundError: org/apache/log4j/Logger

问题描述:

I'm developing a java code in Netbeans 8 that external jars. The project runs as expected when I run it from Netbeans IDE, but executing the jar generated using the Clean and Build function of the IDE(jar gets placed in the dist directory and the dependent jars in the lib directory inside dist), gives the following error during runtime

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/log4j/Logger

at com.informatica.powercenter.sdk.mapfwk.util.Logger.<init>(Unknown Source)

at com.informatica.powercenter.sdk.mapfwk.util.Logger.getLogger(Unknown Source)

at com.informatica.powercenter.sdk.mapfwk.util.JMFMessageCatalog.<clinit>(Unknown Source)

at com.informatica.powercenter.sdk.mapfwk.repository.Repository.<clinit>(Unknown Source)

at CM.CreateMappingFresh.createRepository(CreateMappingFresh.java:463)

at CM.Base.init(Base.java:69)

at CM.Base.execute(Base.java:57)

at CM.CreateMappingFresh.pc_main(CreateMappingFresh.java:125)

at CM.GUI2.jButton_GenerateXMLActionPerformed(GUI2.java:972)

at CM.GUI2.access$2400(GUI2.java:34)

at CM.GUI2$26.actionPerformed(GUI2.java:598)

at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEventImpl(Unknown Source)

at java.awt.EventQueue.access$200(Unknown Source)

at java.awt.EventQueue$3.run(Unknown Source)

at java.awt.EventQueue$3.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)

at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)

at java.awt.EventQueue$4.run(Unknown Source)

at java.awt.EventQueue$4.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger

at java.net.URLClassLoader$1.run(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

... 47 more

The class mentioned in the second line of the error (Logger.java) is present in a jar at the location com/informatica/powercenter/sdk/mapfwk/util (as mentioned in the error). This jar is included in the Classpath in the manifest.mf as lib/jarname.jar as well(along with the other jars). Please suggest steps to eliminate this error.

分享给朋友:
您可能感兴趣的文章:
随机阅读: