-
Bug
-
Resolution: Won't Do
-
Major
-
4.6.0.Final
-
None
When attempting to configure the Lucene Index provider in ModeShape 4 with a custom analyzer class like:
<index-provider classname="lucene" path="modeshape/artifacts/indexes_lucene" relative-to="jboss.server.data.dir" module="org.modeshape.index-provider.lucene" lockFactoryClass="org.apache.lucene.store.NoLockFactory" directoryClass="org.apache.lucene.store.RAMDirectory" analyzerClass="org.apache.lucene.analysis.ro.RomanianAnalyzer" codec="Lucene53"
at runtime the following exception will be raised:
2:10:42,116 INFO [org.infinispan.factories.GlobalComponentRegistry] (default task-2) ISPN000128: Infinispan version: Infinispan 'Insanely Bad Elf' 7.2.4.Final 12:10:44,313 ERROR [org.modeshape.jcr.JcrRepository] (default task-2) Unable to initialize the "lucene" index provider for repository "artifacts": org.apache.lucene.analysis.ro.RomanianAnalyzer cannot be cast to org.apache.lucene.analysis.Analyzer: java.lang.ClassCastException: org.apache.lucene.analysis.ro.RomanianAnalyzer cannot be cast to org.apache.lucene.analysis.Analyzer at org.modeshape.jcr.index.lucene.LuceneConfig.analyzer(LuceneConfig.java:171) at org.modeshape.jcr.index.lucene.LuceneConfig.<init>(LuceneConfig.java:78) at org.modeshape.jcr.index.lucene.LuceneIndexProvider.doInitialize(LuceneIndexProvider.java:85) at org.modeshape.jcr.spi.index.provider.IndexProvider.initialize(IndexProvider.java:295) at org.modeshape.jcr.RepositoryIndexManager.doInitialize(RepositoryIndexManager.java:250) at org.modeshape.jcr.RepositoryIndexManager.initialize(RepositoryIndexManager.java:161) at org.modeshape.jcr.RepositoryQueryManager.initialize(RepositoryQueryManager.java:105) at org.modeshape.jcr.JcrRepository$RunningState.completeInitialization(JcrRepository.java:1326) at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:390) at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:653) at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:624)
The reason is that multiple Lucene modules are installed, since Infinispan uses Lucene 4.10 and ModeShape requires Lucene 5.3.1