Take the 2-minute tour ×

How to handle this error in lucene:

java.lang.AbstractMethodError: org.apache.lucene.store.Directory.listAll()[Ljava/lang/String;
        at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:568)
        at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:69)
        at org.apache.lucene.index.IndexReader.open(IndexReader.java:316)
        at org.apache.lucene.index.IndexReader.open(IndexReader.java:188)

I am making a lucene function call but unfortunately it itself calls an abstract method of some class, as is evident from the error above. What is the work around for this?

Thanks, Akhil

share|improve this question
add comment

3 Answers

An AbstractMethodError can only occur when a class definition has changed incompatibly, so it looks like you're using an incompatible combination of JARs of different parts of Lucene. Try updating all your Lucene JARs to the latest version.

share|improve this answer
You are right! I am using lucene-core-3.0.0 and another hadoop-contrib-index.jar that I got with hadoop-0.19.0 a year ago. Probably at that time lucene had some otehr version. I will try to get new jar for hadoop-contrib-index. let's see if that works. Thanks! –  Akhil May 4 '10 at 7:33
add comment

Another option is that something bad happened to your index - either it was built using a different version of Lucene, or a file is missing. Try opening the index using luke.

share|improve this answer
Nah, that couldn't cause an AbstractMethodError. –  Michael Borgwardt May 4 '10 at 7:44
add comment
up vote 0 down vote accepted

Ok! I found the answer. It was not the problem of version mismatch. Rather the hadoop contrib's FileSystemDirectory which extends abstract class Directory did not implement the abstract function listAll(). listAll() function was being called by lucene indexReader.open() function. I added this function and it is up and running now.


share|improve this answer
add comment

Your Answer


