java.lang.NoClassDefFoundError: org/apache/logging/log4j/spi/LoggerContextShutdownAware
问题现象
为了修复 Apache Log4j2 远程代码执行漏洞,将 log4j-core 从 2.12.0 升级到 2.17.0,启动应用后报错:
"D:\Program Files\jdk-8\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2021.3\lib\idea_rt.jar=62462:D:\Program Files\JetBrains\IntelliJ IDEA 2021.3\bin" -Dfile.encoding=UTF-8 -classpath "D:\Program Files\jdk-8\jre\lib\charsets.jar;D:\Program Files\jdk-8\jre\lib\ext\cldrdata.jar;D:\Program Files\jdk-8\jre\lib\ext\dnsns.jar;D:\Program Files\jdk-8\jre\lib\ext\localedata.jar;D:\Program Files\jdk-8\jre\lib\ext\nashorn.jar;D:\Program Files\jdk-8\jre\lib\ext\sunec.jar;D:\Program Files\jdk-8\jre\lib\ext\sunjce_provider.jar;D:\Program Files\jdk-8\jre\lib\ext\sunmscapi.jar;D:\Program Files\jdk-8\jre\lib\ext\sunpkcs11.jar;D:\Program Files\jdk-8\jre\lib\ext\zipfs.jar;D:\Program Files\jdk-8\jre\lib\jce.jar;D:\Program Files\jdk-8\jre\lib\jsse.jar;D:\Program Files\jdk-8\jre\lib\management-agent.jar;D:\Program Files\jdk-8\jre\lib\resources.jar;D:\Program Files\jdk-8\jre\lib\rt.jar;D:\Source\bigdata\data\api\target\classes;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot-starter-web\2.1.1.RELEASE\spring-boot-starter-web-2.1.1.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot-starter-json\2.1.1.RELEASE\spring-boot-starter-json-2.1.1.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\com\fasterxml\jackson\core\jackson-databind\2.9.7\jackson-databind-2.9.7.jar;D:\Program Files\apache-maven-3.6.3\repository\com\fasterxml\jackson\core\jackson-core\2.9.7\jackson-core-2.9.7.jar;D:\Program Files\apache-maven-3.6.3\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.7\jackson-datatype-jdk8-2.9.7.jar;D:\Program Files\apache-maven-3.6.3\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.7\jackson-datatype-jsr310-2.9.7.jar;D:\Program Files\apache-maven-3.6.3\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.7\jackson-module-parameter-names-2.9.7.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.1.RELEASE\spring-boot-starter-tomcat-2.1.1.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.13\tomcat-embed-core-9.0.13.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.13\tomcat-embed-el-9.0.13.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.13\tomcat-embed-websocket-9.0.13.jar;D:\Program Files\apache-maven-3.6.3\repository\org\hibernate\validator\hibernate-validator\6.0.13.Final\hibernate-validator-6.0.13.Final.jar;D:\Program Files\apache-maven-3.6.3\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;D:\Program Files\apache-maven-3.6.3\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-web\5.1.3.RELEASE\spring-web-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-beans\5.1.3.RELEASE\spring-beans-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-webmvc\5.1.3.RELEASE\spring-webmvc-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-context\5.1.3.RELEASE\spring-context-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-expression\5.1.3.RELEASE\spring-expression-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\io\springfox\springfox-swagger2\2.9.2\springfox-swagger2-2.9.2.jar;D:\Program Files\apache-maven-3.6.3\repository\io\springfox\springfox-spi\2.9.2\springfox-spi-2.9.2.jar;D:\Program Files\apache-maven-3.6.3\repository\io\springfox\springfox-core\2.9.2\springfox-core-2.9.2.jar;D:\Program Files\apache-maven-3.6.3\repository\io\springfox\springfox-schema\2.9.2\springfox-schema-2.9.2.jar;D:\Program Files\apache-maven-3.6.3\repository\io\springfox\springfox-swagger-common\2.9.2\springfox-swagger-common-2.9.2.jar;D:\Program Files\apache-maven-3.6.3\repository\io\springfox\springfox-spring-web\2.9.2\springfox-spring-web-2.9.2.jar;D:\Program Files\apache-maven-3.6.3\repository\com\google\guava\guava\20.0\guava-20.0.jar;D:\Program Files\apache-maven-3.6.3\repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\plugin\spring-plugin-core\1.2.0.RELEASE\spring-plugin-core-1.2.0.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\plugin\spring-plugin-metadata\1.2.0.RELEASE\spring-plugin-metadata-1.2.0.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\mapstruct\mapstruct\1.2.0.Final\mapstruct-1.2.0.Final.jar;D:\Program Files\apache-maven-3.6.3\repository\io\springfox\springfox-swagger-ui\2.9.2\springfox-swagger-ui-2.9.2.jar;D:\Program Files\apache-maven-3.6.3\repository\io\swagger\swagger-annotations\1.5.22\swagger-annotations-1.5.22.jar;D:\Program Files\apache-maven-3.6.3\repository\io\swagger\swagger-models\1.5.22\swagger-models-1.5.22.jar;D:\Program Files\apache-maven-3.6.3\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;D:\Program Files\apache-maven-3.6.3\repository\com\github\xiaoymin\swagger-bootstrap-ui\1.9.5\swagger-bootstrap-ui-1.9.5.jar;D:\Program Files\apache-maven-3.6.3\repository\org\javassist\javassist\3.25.0-GA\javassist-3.25.0-GA.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot-starter-aop\2.1.1.RELEASE\spring-boot-starter-aop-2.1.1.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-aop\5.1.3.RELEASE\spring-aop-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\aspectj\aspectjweaver\1.9.2\aspectjweaver-1.9.2.jar;D:\Source\bigdata\data\service\target\classes;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot-starter-data-redis\2.1.1.RELEASE\spring-boot-starter-data-redis-2.1.1.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\data\spring-data-redis\2.1.3.RELEASE\spring-data-redis-2.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\data\spring-data-keyvalue\2.1.3.RELEASE\spring-data-keyvalue-2.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\data\spring-data-commons\2.1.3.RELEASE\spring-data-commons-2.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-tx\5.1.3.RELEASE\spring-tx-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-oxm\5.1.3.RELEASE\spring-oxm-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-context-support\5.1.3.RELEASE\spring-context-support-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\io\lettuce\lettuce-core\5.1.3.RELEASE\lettuce-core-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\io\projectreactor\reactor-core\3.2.3.RELEASE\reactor-core-3.2.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\reactivestreams\reactive-streams\1.0.2\reactive-streams-1.0.2.jar;D:\Program Files\apache-maven-3.6.3\repository\io\netty\netty-common\4.1.31.Final\netty-common-4.1.31.Final.jar;D:\Program Files\apache-maven-3.6.3\repository\io\netty\netty-transport\4.1.31.Final\netty-transport-4.1.31.Final.jar;D:\Program Files\apache-maven-3.6.3\repository\io\netty\netty-buffer\4.1.31.Final\netty-buffer-4.1.31.Final.jar;D:\Program Files\apache-maven-3.6.3\repository\io\netty\netty-resolver\4.1.31.Final\netty-resolver-4.1.31.Final.jar;D:\Program Files\apache-maven-3.6.3\repository\io\netty\netty-handler\4.1.31.Final\netty-handler-4.1.31.Final.jar;D:\Program Files\apache-maven-3.6.3\repository\io\netty\netty-codec\4.1.31.Final\netty-codec-4.1.31.Final.jar;D:\Source\bigdata\data\dao.main\target\classes;D:\Program Files\apache-maven-3.6.3\repository\com\alibaba\druid\1.1.17\druid-1.1.17.jar;D:\Program Files\apache-maven-3.6.3\repository\com\jfinal\activerecord\4.2\activerecord-4.2.jar;D:\Program Files\apache-maven-3.6.3\repository\mysql\mysql-connector-java\8.0.13\mysql-connector-java-8.0.13.jar;D:\Source\bigdata\data\dao.hbase\target\classes;D:\Program Files\apache-maven-3.6.3\repository\org\apache\hbase\hbase-client\1.2.0-cdh5.14.2\hbase-client-1.2.0-cdh5.14.2.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\hbase\hbase-annotations\1.2.0-cdh5.14.2\hbase-annotations-1.2.0-cdh5.14.2.jar;D:\Program Files\apache-maven-3.6.3\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\hbase\hbase-common\1.2.0-cdh5.14.2\hbase-common-1.2.0-cdh5.14.2.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;D:\Program Files\apache-maven-3.6.3\repository\org\mortbay\jetty\jetty-util\6.1.26.cloudera.4\jetty-util-6.1.26.cloudera.4.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\hadoop\hadoop-core\2.6.0-mr1-cdh5.14.2\hadoop-core-2.6.0-mr1-cdh5.14.2.jar;D:\Program Files\apache-maven-3.6.3\repository\tomcat\jasper-runtime\5.5.23\jasper-runtime-5.5.23.jar;D:\Program Files\apache-maven-3.6.3\repository\tomcat\jasper-compiler\5.5.23\jasper-compiler-5.5.23.jar;D:\Program Files\apache-maven-3.6.3\repository\javax\servlet\jsp\jsp-api\2.1\jsp-api-2.1.jar;D:\Program Files\apache-maven-3.6.3\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar;D:\Program Files\apache-maven-3.6.3\repository\hsqldb\hsqldb\1.8.0.10\hsqldb-1.8.0.10.jar;D:\Program Files\apache-maven-3.6.3\repository\org\eclipse\jdt\core\3.1.1\core-3.1.1.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\hbase\hbase-protocol\1.2.0-cdh5.14.2\hbase-protocol-1.2.0-cdh5.14.2.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-io\commons-io\2.4\commons-io-2.4.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;D:\Program Files\apache-maven-3.6.3\repository\com\google\protobuf\protobuf-java\2.5.0\protobuf-java-2.5.0.jar;D:\Program Files\apache-maven-3.6.3\repository\io\netty\netty-all\4.1.31.Final\netty-all-4.1.31.Final.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\zookeeper\zookeeper\3.4.5-cdh5.14.2\zookeeper-3.4.5-cdh5.14.2.jar;D:\Program Files\apache-maven-3.6.3\repository\org\slf4j\slf4j-log4j12\1.7.25\slf4j-log4j12-1.7.25.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\htrace\htrace-core\3.2.0-incubating\htrace-core-3.2.0-incubating.jar;D:\Program Files\apache-maven-3.6.3\repository\org\codehaus\jackson\jackson-mapper-asl\1.8.8\jackson-mapper-asl-1.8.8.jar;D:\Program Files\apache-maven-3.6.3\repository\org\codehaus\jackson\jackson-core-asl\1.8.8\jackson-core-asl-1.8.8.jar;D:\Program Files\apache-maven-3.6.3\repository\org\jruby\jcodings\jcodings\1.0.8\jcodings-1.0.8.jar;D:\Program Files\apache-maven-3.6.3\repository\org\jruby\joni\joni\2.1.2\joni-2.1.2.jar;D:\Program Files\apache-maven-3.6.3\repository\com\yammer\metrics\metrics-core\2.2.0\metrics-core-2.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\hadoop\hadoop-common\2.6.0-cdh5.14.2\hadoop-common-2.6.0-cdh5.14.2.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\commons\commons-math3\3.1.1\commons-math3-3.1.1.jar;D:\Program Files\apache-maven-3.6.3\repository\xmlenc\xmlenc\0.52\xmlenc-0.52.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-net\commons-net\3.1\commons-net-3.1.jar;D:\Program Files\apache-maven-3.6.3\repository\org\mortbay\jetty\jetty\6.1.26.cloudera.4\jetty-6.1.26.cloudera.4.jar;D:\Program Files\apache-maven-3.6.3\repository\com\sun\jersey\jersey-core\1.9\jersey-core-1.9.jar;D:\Program Files\apache-maven-3.6.3\repository\com\sun\jersey\jersey-json\1.9\jersey-json-1.9.jar;D:\Program Files\apache-maven-3.6.3\repository\org\codehaus\jettison\jettison\1.1\jettison-1.1.jar;D:\Program Files\apache-maven-3.6.3\repository\com\sun\xml\bind\jaxb-impl\2.2.3-1\jaxb-impl-2.2.3-1.jar;D:\Program Files\apache-maven-3.6.3\repository\org\codehaus\jackson\jackson-jaxrs\1.8.3\jackson-jaxrs-1.8.3.jar;D:\Program Files\apache-maven-3.6.3\repository\org\codehaus\jackson\jackson-xc\1.8.3\jackson-xc-1.8.3.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-el\commons-el\1.0\commons-el-1.0.jar;D:\Program Files\apache-maven-3.6.3\repository\net\java\dev\jets3t\jets3t\0.9.0\jets3t-0.9.0.jar;D:\Program Files\apache-maven-3.6.3\repository\com\jamesmurty\utils\java-xmlbuilder\0.4\java-xmlbuilder-0.4.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-configuration\commons-configuration\1.6\commons-configuration-1.6.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-digester\commons-digester\1.8\commons-digester-1.8.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar;D:\Program Files\apache-maven-3.6.3\repository\commons-beanutils\commons-beanutils-core\1.8.0\commons-beanutils-core-1.8.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\avro\avro\1.7.6-cdh5.14.2\avro-1.7.6-cdh5.14.2.jar;D:\Program Files\apache-maven-3.6.3\repository\com\thoughtworks\paranamer\paranamer\2.3\paranamer-2.3.jar;D:\Program Files\apache-maven-3.6.3\repository\org\xerial\snappy\snappy-java\1.0.4.1\snappy-java-1.0.4.1.jar;D:\Program Files\apache-maven-3.6.3\repository\com\google\code\gson\gson\2.8.5\gson-2.8.5.jar;D:\Program Files\apache-maven-3.6.3\repository\com\jcraft\jsch\0.1.42\jsch-0.1.42.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\curator\curator-client\2.7.1\curator-client-2.7.1.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\curator\curator-recipes\2.7.1\curator-recipes-2.7.1.jar;D:\Program Files\apache-maven-3.6.3\repository\com\google\code\findbugs\jsr305\3.0.0\jsr305-3.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\htrace\htrace-core4\4.0.1-incubating\htrace-core4-4.0.1-incubating.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\commons\commons-compress\1.4.1\commons-compress-1.4.1.jar;D:\Program Files\apache-maven-3.6.3\repository\org\tukaani\xz\1.0\xz-1.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\hadoop\hadoop-annotations\2.6.0-cdh5.14.2\hadoop-annotations-2.6.0-cdh5.14.2.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\hadoop\hadoop-auth\2.6.0-cdh5.14.2\hadoop-auth-2.6.0-cdh5.14.2.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\httpcomponents\httpclient\4.5.6\httpclient-4.5.6.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\directory\server\apacheds-kerberos-codec\2.0.0-M15\apacheds-kerberos-codec-2.0.0-M15.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\directory\server\apacheds-i18n\2.0.0-M15\apacheds-i18n-2.0.0-M15.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\directory\api\api-asn1-api\1.0.0-M20\api-asn1-api-1.0.0-M20.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\directory\api\api-util\1.0.0-M20\api-util-1.0.0-M20.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\curator\curator-framework\2.7.1\curator-framework-2.7.1.jar;D:\Program Files\apache-maven-3.6.3\repository\com\github\stephenc\findbugs\findbugs-annotations\1.3.9-1\findbugs-annotations-1.3.9-1.jar;D:\Source\bigdata\data\dao.gops\target\classes;D:\Program Files\apache-maven-3.6.3\repository\com\microsoft\sqlserver\sqljdbc4\4.0\sqljdbc4-4.0.jar;D:\Source\bigdata\data\common\target\classes;D:\Source\bigdata\data\dao.elasticsearch\target\classes;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\elasticsearch\7.2.0\elasticsearch-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\elasticsearch-core\7.2.0\elasticsearch-core-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\elasticsearch-secure-sm\7.2.0\elasticsearch-secure-sm-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\elasticsearch-x-content\7.2.0\elasticsearch-x-content-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-smile\2.9.7\jackson-dataformat-smile-2.9.7.jar;D:\Program Files\apache-maven-3.6.3\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.9.7\jackson-dataformat-yaml-2.9.7.jar;D:\Program Files\apache-maven-3.6.3\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-cbor\2.9.7\jackson-dataformat-cbor-2.9.7.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\elasticsearch-geo\7.2.0\elasticsearch-geo-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-core\8.0.0\lucene-core-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-analyzers-common\8.0.0\lucene-analyzers-common-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-backward-codecs\8.0.0\lucene-backward-codecs-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-grouping\8.0.0\lucene-grouping-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-highlighter\8.0.0\lucene-highlighter-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-join\8.0.0\lucene-join-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-memory\8.0.0\lucene-memory-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-misc\8.0.0\lucene-misc-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-queries\8.0.0\lucene-queries-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-queryparser\8.0.0\lucene-queryparser-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-sandbox\8.0.0\lucene-sandbox-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-spatial\8.0.0\lucene-spatial-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-spatial-extras\8.0.0\lucene-spatial-extras-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-spatial3d\8.0.0\lucene-spatial3d-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\lucene\lucene-suggest\8.0.0\lucene-suggest-8.0.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\elasticsearch-cli\7.2.0\elasticsearch-cli-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\net\sf\jopt-simple\jopt-simple\5.0.2\jopt-simple-5.0.2.jar;D:\Program Files\apache-maven-3.6.3\repository\com\carrotsearch\hppc\0.7.1\hppc-0.7.1.jar;D:\Program Files\apache-maven-3.6.3\repository\joda-time\joda-time\2.10.1\joda-time-2.10.1.jar;D:\Program Files\apache-maven-3.6.3\repository\com\tdunning\t-digest\3.2\t-digest-3.2.jar;D:\Program Files\apache-maven-3.6.3\repository\org\hdrhistogram\HdrHistogram\2.1.9\HdrHistogram-2.1.9.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\jna\4.5.1\jna-4.5.1.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\client\elasticsearch-rest-high-level-client\7.2.0\elasticsearch-rest-high-level-client-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\client\elasticsearch-rest-client\7.2.0\elasticsearch-rest-client-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\httpcomponents\httpcore\4.4.10\httpcore-4.4.10.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\httpcomponents\httpasyncclient\4.1.4\httpasyncclient-4.1.4.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\httpcomponents\httpcore-nio\4.4.10\httpcore-nio-4.4.10.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\plugin\parent-join-client\7.2.0\parent-join-client-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\plugin\aggs-matrix-stats-client\7.2.0\aggs-matrix-stats-client-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\plugin\rank-eval-client\7.2.0\rank-eval-client-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\elasticsearch\plugin\lang-mustache-client\7.2.0\lang-mustache-client-7.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\com\github\spullara\mustache\java\compiler\0.9.3\compiler-0.9.3.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\logging\log4j\log4j-core\2.17.0\log4j-core-2.17.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\apache\logging\log4j\log4j-api\2.11.1\log4j-api-2.11.1.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot-starter\2.1.1.RELEASE\spring-boot-starter-2.1.1.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot\2.1.1.RELEASE\spring-boot-2.1.1.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.1.RELEASE\spring-boot-autoconfigure-2.1.1.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-core\5.1.3.RELEASE\spring-core-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-jcl\5.1.3.RELEASE\spring-jcl-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;D:\Program Files\apache-maven-3.6.3\repository\cn\hutool\hutool-all\4.2.1\hutool-all-4.2.1.jar;D:\Program Files\apache-maven-3.6.3\repository\com\alibaba\fastjson\1.2.54\fastjson-1.2.54.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot-starter-test\2.1.1.RELEASE\spring-boot-starter-test-2.1.1.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot-test\2.1.1.RELEASE\spring-boot-test-2.1.1.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot-test-autoconfigure\2.1.1.RELEASE\spring-boot-test-autoconfigure-2.1.1.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\com\jayway\jsonpath\json-path\2.4.0\json-path-2.4.0.jar;D:\Program Files\apache-maven-3.6.3\repository\net\minidev\json-smart\2.3\json-smart-2.3.jar;D:\Program Files\apache-maven-3.6.3\repository\net\minidev\accessors-smart\1.2\accessors-smart-1.2.jar;D:\Program Files\apache-maven-3.6.3\repository\org\ow2\asm\asm\5.0.4\asm-5.0.4.jar;D:\Program Files\apache-maven-3.6.3\repository\junit\junit\4.12\junit-4.12.jar;D:\Program Files\apache-maven-3.6.3\repository\org\assertj\assertj-core\3.11.1\assertj-core-3.11.1.jar;D:\Program Files\apache-maven-3.6.3\repository\org\mockito\mockito-core\2.23.4\mockito-core-2.23.4.jar;D:\Program Files\apache-maven-3.6.3\repository\net\bytebuddy\byte-buddy\1.9.5\byte-buddy-1.9.5.jar;D:\Program Files\apache-maven-3.6.3\repository\net\bytebuddy\byte-buddy-agent\1.9.5\byte-buddy-agent-1.9.5.jar;D:\Program Files\apache-maven-3.6.3\repository\org\objenesis\objenesis\2.6\objenesis-2.6.jar;D:\Program Files\apache-maven-3.6.3\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\Program Files\apache-maven-3.6.3\repository\org\hamcrest\hamcrest-library\1.3\hamcrest-library-1.3.jar;D:\Program Files\apache-maven-3.6.3\repository\org\skyscreamer\jsonassert\1.5.0\jsonassert-1.5.0.jar;D:\Program Files\apache-maven-3.6.3\repository\com\vaadin\external\google\android-json\0.0.20131108.vaadin1\android-json-0.0.20131108.vaadin1.jar;D:\Program Files\apache-maven-3.6.3\repository\org\springframework\spring-test\5.1.3.RELEASE\spring-test-5.1.3.RELEASE.jar;D:\Program Files\apache-maven-3.6.3\repository\org\xmlunit\xmlunit-core\2.6.2\xmlunit-core-2.6.2.jar;D:\Program Files\apache-maven-3.6.3\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;D:\Program Files\apache-maven-3.6.3\repository\javax\activation\javax.activation-api\1.2.0\javax.activation-api-1.2.0.jar;D:\Program Files\apache-maven-3.6.3\repository\org\projectlombok\lombok\1.18.12\lombok-1.18.12.jar" com.goodwe.data.api.ApiApplication
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/spi/LoggerContextShutdownAware
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
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)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector(Log4jContextFactory.java:108)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:61)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:94)
at org.apache.commons.logging.LogAdapter$Log4jLog.<clinit>(LogAdapter.java:135)
at org.apache.commons.logging.LogAdapter$Log4jAdapter.createLog(LogAdapter.java:102)
at org.apache.commons.logging.LogAdapter.createLog(LogAdapter.java:79)
at org.apache.commons.logging.LogFactoryService.getInstance(LogFactoryService.java:46)
at org.apache.commons.logging.LogFactoryService.getInstance(LogFactoryService.java:41)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:194)
at com.goodwe.data.api.ApiApplication.main(ApiApplication.java:33)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.spi.LoggerContextShutdownAware
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)
... 28 more
Process finished with exit code 1
问题原因
查看 Maven 依赖,发现 log4j-core 2.17.0 引用的竟然是 log4j-api 2.11.1:
解决方法
浏览 【核弹级漏洞】Apache Log4j 远程代码执行漏洞以及修复建议 时发现,应该在 pom 文件里指定 log4j-api 版本,遂修改如下:
<!-- 修复 Apache Log4j2 远程代码执行漏洞 -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.0</version>
</dependency>