nasirodin opened a new issue, #1223:
URL: https://github.com/apache/lucenenet/issues/1223
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
When creating an IndexWriterConfig (Lucene.NET 4.8 beta) and initializing
Lucene, DefaultCodecFactory.Initialize() can throw an unhandled
NullReferenceException. The stack trace shows the exception originates from
NamedServiceFactory<Codec>.CodecsAssembly, which calls Type.GetType(...).
### Expected Behavior
_No response_
### Steps To Reproduce
`
private const LuceneVersion Version = LuceneVersion.LUCENE_48;
_analyzer = new PerFieldAnalyzerWrapper(new StandardAnalyzer(Version),
analyzerMap);
IndexWriterConfig indexConfig = new(Version, _analyzer)
{
Codec = new Lucene46Codec()
};
_writer = new IndexWriter(_directory, indexConfig);
`
### Exceptions (if any)
System.NullReferenceException: Object reference not set to an instance of an
object.
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle
stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName,
ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&
stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.Type.GetType(String typeName)
at Lucene.Net.Util.NamedServiceFactory`1.get_CodecsAssembly()
at Lucene.Net.Codecs.DefaultCodecFactory.Initialize()
at Lucene.Net.Util.NamedServiceFactory`1.<EnsureInitialized>b__4_0()
at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target,
Boolean& initialized, Object& syncLock, Func`1 valueFactory)
at Lucene.Net.Util.NamedServiceFactory`1.EnsureInitialized()
at Lucene.Net.Codecs.DefaultCodecFactory.GetCodec(String name)
at Lucene.Net.Codecs.Codec.get_Default()
at Lucene.Net.Index.LiveIndexWriterConfig..ctor(Analyzer analyzer,
LuceneVersion matchVersion)
at BIMLOGiQ.CopilotPlugin.FullIndexSearch.LuceneSearch`1..ctor()
at
BIMLOGiQ.CopilotPlugin.Services.Symbols.SymbolCache..ctor(ICommandExtenderService
commandExtenderService, IEnumerable`1 symbolItems, IEnumerable`1
symbolCategories)
at
BIMLOGiQ.CopilotPlugin.Services.Symbols.SymbolService.<>c__DisplayClass13_0.<EnsureBuildSymbolCache>b__1(UIApplication
app)
at
Revit.Async.RevitTask.<>c__DisplayClass20_0.<RunAsync>b__0(UIApplication app)
at
Revit.Async.Extensions.ExternalEventResultHandlerExtensions.Wait[TResult](IExternalEventResultHandler`1
resultHandler, Func`1 function)
### Lucene.NET Version
4.8.0-beta00016
### .NET Version
net48
### Operating System
_No response_
### Anything else?
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]