Hi,
we can't help you here without a full source code and your build system
setup. Generally those errors only happen if you are using some shading
or any other tool that creates UBER JARs. E.g. for Maven's UBER JARS you
need to add the some resource ransformers, so it includes all necessary
files. I checked the JAR file of Lucene, it has all services entries.
General recommendation: Please do not repackage lucene, use the
*original* JAR files. Also if you are using the Java 11 module system in
your project, it is very important to not repackage JARs, otherwise it
breaks completely! This is why: Because in Java 11 when module system is
used, service providers are found by the module-info.class files as part
of every JAR (META-INF is no longer used). And this file with exact same
name is part of every JAR file. When you merge them it breaks as only
one survives (e.g. the one from Lucene Core as I see in your output
(Lucene core only has the standard tokenizer).
Uwe
Am 28.10.2022 um 21:46 schrieb Shifflett, David [USA]:
I am migrating my project’s usage of Lucene from 8.2 to 9.4.
The migration documentation has been very helpful,
but doesn’t help me resolve this exception:
‘Caused by: java.lang.IllegalArgumentException: A SPI class of type
org.apache.lucene.analysis.TokenizerFactory with name 'whitespace' does not
exist. You need to add the corresponding JAR file supporting this SPI to your
classpath. The current classpath supports the following names: [standard]’
My project includes the lucene-analysis-common JAR,
and my JAR includes
org/apache/lucene/analysis/core/WhitespaceTokenizerFactory.class.
I am not familiar with how Java SPI is configured and built.
I tried creating META-INF/services/org.apache.lucene.analysis.TokenizerFactory
containing: org.apache.lucene.analysis.core.WhitespaceTokenizerFactory
What am I missing?
Any help would be appreciated.
Thanks,
David Shifflett
--
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail: u...@thetaphi.de
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org