buddyli / mmseg4j

Automatically exported from code.google.com/p/mmseg4j
Apache License 2.0
0 stars 0 forks source link

mmseg4j 1.9.1 + Solr 4.6.0 報錯 #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Solr 4.6.0 回報下列錯誤訊息:

TokenStream contract violation: reset()/close() call missing, reset() called 
multiple times, or subclass does not call super.reset(). Please see Javadocs of 
TokenStream class for more information about the correct consuming workflow.

Original issue reported on code.google.com by virus.wa...@gmail.com on 12 Dec 2013 at 3:29

Attachments:

GoogleCodeExporter commented 9 years ago
http://lucene.apache.org/core/4_6_0/changes/Changes.html#v4.6.0.changes_in_backw
ards_compatibility_policy

LUCENE-5235: Sub classes of Tokenizer have to call super.reset() when 
implementing reset(). Otherwise the consumer will get an IllegalStateException 
because the Reader is not correctly assigned. It is important to never change 
the "input" field on Tokenizer without using setReader(). The "input" field 
must not be used outside reset(), incrementToken(), or end() - especially not 
in the constructor. 

MMSegTokenizer.java

public void reset() throws IOException {
        //lucene 4.0
        //org.apache.lucene.analysis.Tokenizer.setReader(Reader)
        //setReader 自动被调用, input 自动被设置。
        super.reset();   //加这一句
        mmSeg.reset(input);
    }

重新打包
mvn package 

Original comment by duart...@gmail.com on 12 Dec 2013 at 1:06

GoogleCodeExporter commented 9 years ago
Thanks a lot.

Original comment by virus.wa...@gmail.com on 13 Dec 2013 at 3:31

GoogleCodeExporter commented 9 years ago
谢谢,很严谨有效的回答

Original comment by huiguipi...@gmail.com on 13 Jan 2014 at 3:04

GoogleCodeExporter commented 9 years ago
能否请哪位把重新打包后的包上传上来,我这里因为种种原��
�,没法打包,多谢多谢

Original comment by siceb...@gmail.com on 13 Feb 2014 at 10:09

GoogleCodeExporter commented 9 years ago
请问你们在修改代码的时候,代码是从哪儿来的?!我没找��
�源代码在哪儿啊?!我也是遇见了上边这个问题。

Original comment by qjayg...@gmail.com on 18 Feb 2014 at 8:44

GoogleCodeExporter commented 9 years ago
其實我也沒有重包,直接放棄 4.6 回去用 4.5 了 XD

Original comment by virus.wa...@gmail.com on 18 Feb 2014 at 10:34

GoogleCodeExporter commented 9 years ago
打个包放到maven上面把

Original comment by wxleida@gmail.com on 13 Mar 2014 at 11:39

GoogleCodeExporter commented 9 years ago
使用 2.0.0

参考 https://github.com/chenlb/mmseg4j-solr

Original comment by chenlb2...@gmail.com on 19 May 2014 at 11:24