lucene4.4与IKAnalyzer的冲突

来源:转载


今天使用lucene4.4和IKAnalyzer3.2.8创建索引的时候出现异常,异常提示:

Exception in thread "main" java.lang.VerifyError: class org.wltea.analyzer.lucene.IKAnalyzer 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.defineClassCond(Unknown Source) 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$000(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.lzz.test.LuceneTest.main(LuceneTest.java:8)

从网上搜索了一些资料发现lucene4.4与IKAnalyzer3.2.8已经不兼容了,最后从网上下载了IKAnalyzer2012FF_u1.jar,从而解决了问题。

下载链接:http://download.csdn.net/detail/ltr15036900300/9110299




分享给朋友:
您可能感兴趣的文章:
随机阅读: