hi Uwe,
   it's ok after I delete old index files. thanks.

2011/12/1 Uwe Schindler <uwe@thetaphi.de>

Hi Lili,

 

The problem is another one: Lucene trunk has no stable index format as it is not yet released. We changed the index format several times causing older indexes not to be readable anymore (of course 3.x indexes are always readable). When then opening those “outdated” index files it will throw this or similar exceptions.

 

You have to completely delete your index and reindex. This is the backside of using a trunk version.

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: uwe@thetaphi.de

 

From: Li Li [mailto:fancyerii@gmail.com]
Sent: Thursday, December 01, 2011 12:28 PM
To: dev@lucene.apache.org
Subject: Codec with name ‘Lucene40′ does not exist

 

hi all

    when I run/debug solr in eclipse, an error occured.

   Caused by: java.lang.IllegalArgumentException: A SPI class of type org.apache.lu

cene.index.codecs.Codec with name '' does not exist. You need to add the corresp

onding JAR file supporting this SPI to your classpath.The current classpath supp

orts the following names: [Lucene40, Lucene3x, SimpleText]

    I found this webpage http://blog.so8848.com/2011/11/55863.html 

    It seems there is something wrong with ServiceLoader.

    So I use ant to build the whole project and unzip  /META-INF/services/org.apache.lucene.index.codecs.Codec into my source code folder

    But it still failed.

    In eclipse's catalina base:

       ‾/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/lucene-solr-trunk/WEB-INF/classes$ ll

drwxr-xr-x 5 lili lili 4096 2011-12-01 19:13 ./

drwxr-xr-x 4 lili lili 4096 2011-12-01 16:17 ../

drwxr-xr-x 3 lili lili 4096 2011-12-01 19:13 META-INF/

drwxr-xr-x 4 lili lili 4096 2011-12-01 16:17 org/

-rw-r--r-- 1 lili lili 2963 2011-08-18 17:22 overview.html

drwxr-xr-x 3 lili lili 4096 2011-12-01 16:17 test/

 

    $ ll META-INF/services/org.apache.lucene.index.codecs.Codec 

-rw-r--r-- 1 lili lili 961 2011-12-01 17:24 META-INF/services/org.apache.lucene.index.codecs.Codec