無法確定是什麼原因導致'名爲'Lucene42'的SPI類型的org.apache.lucene.codecs.Codec不存在。您需要添加相應的JAR文件支持這一SPI到classpath '什麼原因導致錯誤'類型爲lucene.codecs.Codec名稱的SPI類'Lucene42'
任何幫助,將不勝感激
java.lang.IllegalArgumentException: A SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene42' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath.The current classpath supports the following names: []
org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:104)
org.apache.lucene.codecs.Codec.forName(Codec.java:95)
org.apache.lucene.codecs.Codec.<clinit>(Codec.java:122)
org.apache.lucene.index.LiveIndexWriterConfig.<init>(LiveIndexWriterConfig.java:118)
org.apache.lucene.index.IndexWriterConfig.<init>(IndexWriterConfig.java:145)
com.damn.fr.rr.rent.getResukt(Man.java:404)
com.damn.fr.rr.handler.pg.setResult(pg.java:103)
com.damn.fr.rr.cmd.del.execute(del.java:19)
com.damn.fr.rr.servlet.PublicController.doPost(controller.java:199)
javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
JBoss部署文件夾路徑' C:\ JBAS \模塊\組織\阿帕奇\ lucene的\主「和目錄內容
JBoss的部署,structure.xml
<sub-deployment name="damn.jar">
<dependencies>
<module name="org.apache.commons.fileupload" />
<module name="org.apache.commons.io" />
<module name="org.apache.commons.lang3" />
<module name="org.apache.commons.validator" />
<module name="org.apache.lucene" />
<module name="net.sf.jasperreports" />
<module name="com.google.gson" />
</dependencies>
</sub-deployment>
module.xml
<module xmlns="urn:jboss:module:1.0" name="org.apache.lucene">
<resources>
<resource-root path="lucene-analyzers-common-4.2.0.jar"/>
<resource-root path="lucene-core-4.2.0.jar"/>
<resource-root path="lucene-queryparser-4.2.0.jar"/>
<resource-root path="lucene-codecs-4.2.0.jar"/>
</resources>
<dependencies>
</dependencies>
Ant構建文件段
<pathelement path="${thirdPartyDir}/lucene-analyzers-common-4.2.0.jar" />
<pathelement path="${thirdPartyDir}/lucene-codecs-4.2.0.jar" />
<pathelement path="${thirdPartyDir}/lucene-queryparser- 4.2.0.jar" />
<pathelement path="${thirdPartyDir}/lucene-core-4.2-SNAPSHOT.jar" />
嗨,李,我使用lucene時遇到了類似的錯誤,你有沒有找到解決辦法? – nanoix9
@ nanoix9,還沒有。如果我這樣做,我會讓你知道的。希望你也能做到這一點:) –