配置Paoding分词时出现的错误:java.lang.AbstractMethodError: org.apache.lucene.analysis.TokenStream.incrementToken()

  • Post author:
  • Post category:java




在使用lucene3与paoding集成的时候可能会出现以下错误:



Exception in thread “main” java.lang.AbstractMethodError: org.apache.lucene.analysis.TokenStream.incrementToken()Z

at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:137)

at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:246)

at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:774)

at org.apache.lucene.index.DocumentsWriter.addDocument(DocumentsWriter.java:752)

at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1932)

at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1906)



原因是:

paoding以前发布的jar与lucene3不兼容,而与lucene3兼容的jar还没发布,只发布了源代码,所以在项目中通过源代码的项目加入paoding,而不是jar包,这样就能避免此错误。




与lucene3兼容的paoding 源代码下载地址:



http://paoding.googlecode.com/svn/trunk/paoding-analysis/



需要使用SVN下载。



“庖丁解牛”google 论坛:



http://groups.google.com/group/paoding



旧版本地址:

http://paoding.googlecode.com/svn/trunk/paoding-analysis-1/

不建议下载旧版本