原本使用的是Lucene4.2 ,为是使搜索效果更好,就使用中文分词组件IK analyzer,最新ik只兼容到4.0,就更换为lucene4.0 然后报了下面的的错。求助!!!
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: [Lucene40, Lucene3x]
at org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:104)
at org.apache.lucene.codecs.Codec.forName(Codec.java:95)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:299)
at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:347)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:783)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:630)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:343)
at org.apache.lucene.index.DirectoryReader.indexExists(DirectoryReader.java:322)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:615)
at com.hgj.servlet.TimerIndexServlet$IndexTask.run(TimerIndexServlet.java:92)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
当前系统时间:Thu Jun 12 12:01:01 CST 2014
Lucene4.2开始索引数据库记录......
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: [Lucene40, Lucene3x]
at org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:104)
at org.apache.lucene.codecs.Codec.forName(Codec.java:95)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:299)
at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:347)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:783)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:630)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:343)
at org.apache.lucene.index.DirectoryReader.indexExists(DirectoryReader.java:322)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:615)
at com.hgj.servlet.TimerIndexServlet$IndexTask.index(TimerIndexServlet.java:288)
at com.hgj.servlet.TimerIndexServlet$IndexTask.run(TimerIndexServlet.java:109)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
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: [Lucene40, Lucene3x]