What causes err #39; A SPI class of type lucene.codecs.Codec name #39;Lucene42#39;(是什么导致错误一个 SPI 类型的 lucene.codecs.Codec 名称Lucene42)
问题描述
无法弄清楚是什么原因导致不存在名称为Lucene42"的 org.apache.lucene.codecs.Codec 类型的 SPI 类.您需要将支持此 SPI 的相应 JAR 文件添加到您的类路径中'
Can't figure out what is causing ' 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'
任何帮助将不胜感激
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:JBASmodulesorgapachelucenemain' 和目录内容
Jboss deployment folder path 'C:JBASmodulesorgapachelucenemain' and directory contents
jboss-deployment-structure.xml
jboss-deployment-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>
模块.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" />
推荐答案
请添加以下文件
文件夹:META-INF/services/
文件:org.apache.lucene.codecs.Codec
文本:org.apache.lucene.codecs.lucene54.Lucene54Codec
请在 https://anwaarlabs.wordpress.com/2017/02/25/lucene-an-spi-class-of-type-org-apache-lucene-codecs-codec-with-name-does-not-exist/
此解决方案是为 Lucene5.4 定义的,它也适用于 Lucene 4.2.谢谢
This solution is defined for Lucene5.4 it also works for Lucene 4.2. Thanks
这篇关于是什么导致错误'一个 SPI 类型的 lucene.codecs.Codec 名称'Lucene42'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是什么导致错误'一个 SPI 类型的 lucene.codecs.Codec 名称'Lucene42'


基础教程推荐
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 降序排序:Java Map 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01