Exception in thread “main“ java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/ReflectionU

Posted jiangnianwangluo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Exception in thread “main“ java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/ReflectionU相关的知识,希望对你有一定的参考价值。

 报错信息 :org.apache.logging.log4j.util.ReflectionUtil

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/ReflectionUtil
    at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:42)
    at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
    at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
    at org.apache.flink.configuration.Configuration.<clinit>(Configuration.java:63)
    at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.getExecutionEnvironment(StreamExecutionEnvironment.java:2087)
    at com.jn.Flink.main(Flink.java:19)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.util.ReflectionUtil
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 8 more
 

只写了Flink执行环境就报错Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/ReflectionUtil

检查自己的maven依赖,进入pom文件查找log4j,具体如下图

 

log4j-core与log4j是我原有pom内就存在的

加上蓝框里的log4j-api依赖问题解决

<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-api</artifactId>
    <version>2.8.2</version>
</dependency>

Exception in thread "main" org.springframework.mail.MailSendException; nested exception de

是关于邮件发送的问题,在网上有找资料,说是包不兼容的问题,但是不知道怎么弄,大神,快点出来救救我吧。smtp用的qq的

Exception in thread "main" org.springframework.mail.MailSendException; nested exception details (1) are:
Failed message 1:
com.sun.mail.smtp.SMTPSendFailedException: 503 Error: need EHLO and AUTH first !

at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1275)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:895)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:524)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:388)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:332)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:328)
at cn.hnedu.util.MailSender.sendFileMail(MailSender.java:48)
at cn.hnedu.util.MailSender.main(MailSender.java:54)

参考技术A 那是外国的 参考技术B 。。。。。。。。。。。。。。。。。。

以上是关于Exception in thread “main“ java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/ReflectionU的主要内容,如果未能解决你的问题,请参考以下文章

错误:Exception in thread “main“ java.lang.ClassCastException

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1

Exception in thread "main" java.lang.NullPointerException at Class.main

Exception in thread "main" java.lang.ClassCastException

Exception in thread "main" org.springframework.mail.MailSendException; nested exception de

Exception in thread “main“ java.lang.NoClassDefFoundError: org/apache/flink/