当前位置:首页 > 开发 > 系统架构 > 架构 > 正文

mmseg4j分词器导致的java.lang.AbstractMethodError

发表于: 2014-04-07   作者:alleni123   来源:转载   浏览:
摘要: java.lang.AbstractMethodError: org.apache.lucene.analysis.Analyzer.tokenStream(Ljava/lang/String;Ljava/io/Reader;)Lorg/apache/lucene/analysis/TokenStream; at org.apache.lucene.analysis.Analyzer.reus
java.lang.AbstractMethodError: org.apache.lucene.analysis.Analyzer.tokenStream(Ljava/lang/String;Ljava/io/Reader;)Lorg/apache/lucene/analysis/TokenStream;
at org.apache.lucene.analysis.Analyzer.reusableTokenStream(Analyzer.java:80)


<dependency>
  <groupId>org.apache.tika</groupId>
  <artifactId>tika-app</artifactId>
  <version>1.5</version>
</dependency>


		  <dependency>
			<groupId>com.chenlb.mmseg4j</groupId>
			<artifactId>mmseg4j-analysis</artifactId>
			<version>1.9.1</version>
		</dependency>
		
		<dependency>
	<groupId>com.chenlb.mmseg4j</groupId>
	<artifactId>mmseg4j-core</artifactId>
	<version>1.9.1</version>
</dependency>
            

 



		<dependency>
			<groupId>org.apache.lucene</groupId>
			<artifactId>lucene-core</artifactId>
			<version>3.5.0</version>
		</dependency>

		<dependency>
			<groupId>org.apache.lucene</groupId>
			<artifactId>lucene-highlighter</artifactId>
			<version>3.5.0</version>
		</dependency>


初步配置如上。
当使用MMSegAnalyzer, 就会报错。

java.lang.AbstractMethodError: org.apache.lucene.analysis.Analyzer.tokenStream(Ljava/lang/String;Ljava/io/Reader;)Lorg/apache/lucene/analysis/TokenStream;
at org.apache.lucene.analysis.Analyzer.reusableTokenStream(Analyzer.java:80)
at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:126)
at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:278)
at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:766)
at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2066)
at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2040)
at org.apache.lucene.search.NRTManager.addDocument(NRTManager.java:214)
at com.lj.message.service.IndexService.addIndex(IndexService.java:66)





弄了半天, 最后解决方法是使用下面的中文分词jar和上面的配置搭配。

貌似mvnrepository.com上没有。需要配置个nexus仓库。 麻烦。

mmseg4j分词器导致的java.lang.AbstractMethodError

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号