我使用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
我不知道问题出在哪里,我的lib可能不包括在内吗?我怎样才能确定?或者是因为运行.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
答案 0 :(得分:3)
启用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/