我想使用paoding.analysis.analyzer但我得到错误

时间:2014-11-07 07:49:35

标签: java eclipse lucene

这是Eclipse中的错误:

Exception in thread "main" java.lang.VerifyError: class   net.paoding.analysis.analyzer.PaodingAnalyzerBean overrides final method tokenStream.(Ljava/lang/String;Ljava/io/Reader;)Lorg/apache/lucene/analysis/TokenStream;
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.examle.test.hello.main(hello.java:20)

来源:

package com.examle.test;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.analysis.Analyzer;
import net.paoding.analysis.analyzer.PaodingAnalyzer;
public class hello {
    public static void main(String[] arg) throws Exception{
        String content=null;
        Analyzer analyzer=new PaodingAnalyzer();

   }
}

1 个答案:

答案 0 :(得分:0)

似乎与我的API不匹配。

PaodingAnalyzerBean overrides final method tokenStream.

是一个非常明确的错误信息,不是吗? final方法可能无法覆盖。

任何机会都需要不同版本的Lucene?因此,您使用tokenStream的版本为final,但在正确的版本中,它不是final