如何用 Jetty 修复 "Could not find necessary SLF4j logging jars"?

How to fix "Could not find necessary SLF4j logging jars" with Jetty?

我正在使用 jetty 9 作为我的容器,我想 运行 solr5 在我的容器中,我将所有 .jar 文件从 solr/server/lib/ext 复制到我的 jetty base lib/ext ,但它向我显示此错误:

java.lang.NoClassDefFoundError: Failed to initialize Apache Solr: Could not find necessary SLF4j logging jars. If using Jetty, the SLF4j logging jars need to go in the jetty lib/ext directory. For other containers, the corresponding directory should be used. For more information, see: http://wiki.apache.org/solr/SolrLogging

我不知道问题出在哪里,有没有可能是我的库没有包含在内?我如何确定这一点?还是因为 运行 .jar 文件的优先级? 感谢您的帮助:) 这是 --list-config:

的输出
Java Environment:
-----------------
 java.home = /usr/java/jdk1.8.0_45/jre
 java.vm.vendor = Oracle Corporation
 java.vm.version = 25.45-b02
 java.vm.name = Java HotSpot(TM) 64-Bit Server VM
 java.vm.info = mixed mode
 java.runtime.name = Java(TM) SE Runtime Environment
 java.runtime.version = 1.8.0_45-b14
 java.io.tmpdir = /tmp
 user.dir = /ladan/app
 user.language = en
 user.country = US

Jetty Environment:
-----------------
 jetty.version = 9.3.0.v20150612
 jetty.tag.version = master
 jetty.home = /ladan/lib/jetty-distribution-9.3.0.v20150612
 jetty.base = /ladan/app

Config Search Order:
--------------------
 <command-line>
 ${jetty.base} -> /ladan/app
 ${jetty.home} -> /ladan/lib/jetty-distribution-9.3.0.v20150612


JVM Arguments:
--------------
 (no jvm args specified)

System Properties:
------------------
 (no system properties specified)

Properties:
-----------
 java.io.tmpdir = /ladan/temp
 java.net.preferIPv4Stack = true
 jetty.http.port = 8082

Jetty Server Classpath:
-----------------------
Version Information on 25 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
      changes to the --module=name command line options will be reflected here.
 0:          9.3.0.v20150612 | ${jetty.home}/lib/apache-jsp/org.eclipse.jetty.apache-jsp-9.3.0.v20150612.jar

 1:   3.8.2.v20130121-145325 | ${jetty.home}/lib/apache-jsp/org.eclipse.jetty.orbit.org.eclipse.jdt.core-3.8.2.v20130121.jar

 2:                   8.0.20 | ${jetty.home}/lib/apache-jsp/org.mortbay.jasper.apache-el-8.0.20.M0.jar

 3:                      2.3 | ${jetty.home}/lib/apache-jsp/org.mortbay.jasper.apache-jsp-8.0.20.M0.jar

 4:                    1.2.1 | ${jetty.home}/lib/apache-jstl/org.apache.taglibs.taglibs-standard-impl-1.2.1.jar

 5:                    1.2.1 | ${jetty.home}/lib/apache-jstl/org.apache.taglibs.taglibs-standard-spec-1.2.1.jar

 6:                    3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar

 7:                 3.1.0.M0 | ${jetty.home}/lib/jetty-schemas-3.1.jar

 8:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-http-9.3.0.v20150612.jar

 9:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-server-9.3.0.v20150612.jar

10:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-xml-9.3.0.v20150612.jar

11:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-util-9.3.0.v20150612.jar

12:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-io-9.3.0.v20150612.jar

13:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-jndi-9.3.0.v20150612.jar

14:      1.4.1.v201005082020 | ${jetty.home}/lib/jndi/javax.mail.glassfish-1.4.1.v201005082020.jar

15:                      1.2 | ${jetty.home}/lib/jndi/javax.transaction-api-1.2.jar

16:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-security-9.3.0.v20150612.jar

17:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-servlet-9.3.0.v20150612.jar

18:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-webapp-9.3.0.v20150612.jar

19:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-deploy-9.3.0.v20150612.jar

20:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-plus-9.3.0.v20150612.jar

21:          9.3.0.v20150612 | ${jetty.home}/lib/jetty-annotations-9.3.0.v20150612.jar

22:                    5.0.1 | ${jetty.home}/lib/annotations/asm-5.0.1.jar

23:                    5.0.1 | ${jetty.home}/lib/annotations/asm-commons-5.0.1.jar

24:                      1.2 | ${jetty.home}/lib/annotations/javax.annotation-api-1.2.jar


Jetty Active XMLs:
------------------
 ${jetty.home}/etc/jetty.xml

 ${jetty.home}/etc/jetty-http.xml

 ${jetty.home}/etc/jetty-deploy.xml

 ${jetty.home}/etc/jetty-plus.xml

 ${jetty.home}/etc/jetty-annotations.xml

启用 ext 模块并将 slf4j jar 放在 ${jetty.base}/lib/ext 目录中。

例如:

$ cd /ladan/app
$ java -jar /ladan/lib/jetty-distribution-9.3.0.v20150612/start.jar --add-to-start=ext
$ cp /home/user/downloads/slfj*.jar lib/ext/