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

Simon Svensson commented on LUCENENET-496:
------------------------------------------

QueryParserTokenManager.InitBlack creates a StreamWriter for debugging 
purposes. It will write to Console.OpenStandardOutput() using 
Console.Out.Encoding, and the later is a NotSupportedOperation for 
EqtStringPerThreadWriter (which is a TextWriter). I would guess that the 
testing framework sets Console.Out to a new EqtStringPerThreadWriter, and you 
may be able to workaround this issue by Console.SetOut(new StreamWriter(new 
MemoryStream())) before creating the QueryParser.

I'm not sure who uses the writer created by QueryParserTokenManager, and why 
Console.Out isn't used directly.
                
> System.NotImplementedException occurred in 
> Microsoft.VisualStudio.QualityTools.Common.dll
> -----------------------------------------------------------------------------------------
>
>                 Key: LUCENENET-496
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-496
>             Project: Lucene.Net
>          Issue Type: Bug
>          Components: Lucene.Net Core
>    Affects Versions: Lucene.Net 2.9.4g
>         Environment: VS2010sp1 + mstest on win7 64-bit
>            Reporter: Nicklas Norling
>            Priority: Minor
>
> When enabling parallel tests in VS2010 one of our tests failed consistently 
> with a weird NotImplementedEsxception inside the MS tool.
> The following code is use Lucene.NET 2.9.4.1 from NuGet:
>             analyzer = new 
> StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29);
>             parser = new QueryParser(Lucene.Net.Util.Version.LUCENE_29, 
> "All", analyzer);
> The exception is thrown inside the new QueryParser call. This is the call 
> stack:
> System.NotImplementedException was unhandled by user code
>   Message=The method or operation is not implemented.
>   Source=Microsoft.VisualStudio.QualityTools.Common
>   StackTrace:
>        at 
> Microsoft.VisualStudio.TestTools.Common.EqtStringPerThreadWriter.get_Encoding()
>        at Lucene.Net.QueryParsers.QueryParserTokenManager.InitBlock()
>        at Lucene.Net.QueryParsers.QueryParserTokenManager..ctor(CharStream 
> stream)
>        at Lucene.Net.QueryParsers.QueryParser..ctor(CharStream stream)
>        at Lucene.Net.QueryParsers.QueryParser..ctor(Version matchVersion, 
> String f, Analyzer a)
>        at AuthoringServer.SearchEngine.Searcher..ctor(SearchSettings 
> settings) in [Our code path]\Searcher.cs:line 45
>        at BuildUp_AuthoringServer.SearchEngine.Searcher(IBuilderContext )
>        at 
> Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext
>  context)
>        at 
> Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext
>  context)
>        at 
> Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext
>  context)
> Do not know if this is a MS bug or if Lucene.NET should behave in a different 
> way when logging. Registering here for your judgement.
> Regards,
> Nicke

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to