使用paoding lucene分词 ,遇到java.lang.VerifyError: Cannot inherit from final class 问题

Exception in thread "main" java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at net.paoding.analysis.analyzer.impl.MostWordsTokenCollector.collect(MostWordsTokenCollector.java:41)
at net.paoding.analysis.analyzer.PaodingTokenizer.collect(PaodingTokenizer.java:146)
at net.paoding.analysis.knife.CJKKnife.dissect(CJKKnife.java:181)
at net.paoding.analysis.knife.KnifeBox.dissect(KnifeBox.java:90)
at net.paoding.analysis.knife.SmartKnifeBox.dissect(SmartKnifeBox.java:23)
at net.paoding.analysis.analyzer.PaodingTokenizer.next(PaodingTokenizer.java:182)
at com.boco.paoding.PaodingAnalyzer1.main(PaodingAnalyzer1.java:21)


意思是说我继承了一个final类,这个final类是哪个类呢,是 lucene-core.jar下面的org.apache.lucene.org.apache.lucene.analysis.Token类,这个类被声明为final,但paoding分词会继承这个类,怎么办呢,我查看了下载的paoding-analysis-2.0.4-alpha2包,里面的lucene jar包是2.4版本的,于是我将我工程的lucene版本升至2.4.

你可能感兴趣的:(技术学习)