Java AbstractMethodError

How to deal with 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 make a call to the lucene function, but unfortunately it itself calls an abstract method of some class, as you can see from the above error. What's the job for this?

Thanks, Akhil

+1


a source to share


3 answers


Ok! I found the answer. This is not a version mismatch issue. Rather, the hasoop contrib FileSystemDirectory that extends the abstract class directory did not implement the abstract listAll () function. The listAll () function was called by the lucene indexReader.open () function. I added this feature and it still works.



thanks

0


a source


An AbstractMethodError

can only happen when the class definition has changed inconsistently, so it looks like you are using an incompatible combination of JARs of different parts of Lucene. Try updating all of your Lucene JARs to the latest version.



+3


a source


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

0


a source







All Articles