线程“main”中的异常 java.lang.NoClassDefFoundError: org/apache/logging/log4j/message/Message
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26967189/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/message/Message
提问by ParUpadh
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/message/Message at com.prac.Loger.(Loger.java:34) Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.message.Message 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) ... 1 more
线程“main”中的异常 java.lang.NoClassDefFoundError: org/apache/logging/log4j/message/Message at com.prac.Loger.(Loger.java:34) 引起:java.lang.ClassNotFoundException: org.apache。 logging.log4j.message.Message 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) ... 1 more
Exception points to Loger.java:34
异常指向 Loger.java:34
static Logger logger=Logger.getLogger(Loger.class);
Please help me get rid of this exception...
请帮我摆脱这个异常...
回答by ParUpadh
Added log4j-api-2.1.jar and error is gone.!
添加了 log4j-api-2.1.jar 并且错误消失了。!