You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2014/03/12 19:32:43 UTC

[jira] [Comment Edited] (LUCENE-5523) MemoryIndex.addField violates TokenStream contract

    [ https://issues.apache.org/jira/browse/LUCENE-5523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13932135#comment-13932135 ] 

Uwe Schindler edited comment on LUCENE-5523 at 3/12/14 6:30 PM:
----------------------------------------------------------------

Hi,

can you post your Analyzer definition (which TokenFilters and Tokenizers do you use)? In most cases, a broken custom TokenFilter is causing this. Do you have any TokenFilters or a Tokenizer that was written by you?

Does the same TokenStream work with Lucene's standard IndexWriter?


was (Author: thetaphi):
Hi,

can you post your Analyzer definition (which TokenFilters and Tokenizers) do you use? In most cases, a broken custom TokenFilter is causing this. Do you have any TokenFilters or a Tokenizer that was written by you?

Does the same TokenStream work with Lucene's standard IndexWriter?

> MemoryIndex.addField violates TokenStream contract
> --------------------------------------------------
>
>                 Key: LUCENE-5523
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5523
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: 3.6.1
>            Reporter: Willem Salembier
>
> Running the example from the javadoc page generates a IllegalStateException.
> http://lucene.apache.org/core/4_7_0/memory/org/apache/lucene/index/memory/MemoryIndex.html
> {code}
> java.lang.RuntimeException: java.lang.IllegalStateException: 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.
> 	at org.apache.lucene.index.memory.MemoryIndex.addField(MemoryIndex.java:463)
> 	at org.apache.lucene.index.memory.MemoryIndex.addField(MemoryIndex.java:298)
> 	at be.curtaincall.provisioning.SearchTest.testSearch(SearchTest.java:32)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> 	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> 	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
> 	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
> 	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> Caused by: java.lang.IllegalStateException: 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.
> 	at org.apache.lucene.analysis.Tokenizer$1.read(Tokenizer.java:110)
> 	at org.apache.lucene.analysis.util.CharacterUtils.readFully(CharacterUtils.java:213)
> 	at org.apache.lucene.analysis.util.CharacterUtils$Java5CharacterUtils.fill(CharacterUtils.java:255)
> 	at org.apache.lucene.analysis.util.CharacterUtils.fill(CharacterUtils.java:203)
> 	at org.apache.lucene.analysis.util.CharTokenizer.incrementToken(CharTokenizer.java:135)
> 	at org.apache.lucene.index.memory.MemoryIndex.addField(MemoryIndex.java:429)
> 	... 28 more
> {code}
> Also tested in 3.7.0, but version not yet created in JIRA.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org