Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2578

Cannot configure custom Lucene analzyer class in Wildfly when multiple Lucene modules are installed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • 5.0.0.Final
    • 4.6.0.Final
    • Query
    • 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

              hchiorean Horia Chiorean (Inactive)
              hchiorean Horia Chiorean (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: