1 2 Previous Next 18 Replies Latest reply on Feb 6, 2015 7:08 AM by sannegrinovero Go to original post
      • 15. Re: Re: Re: Re: Re: Wildfly 8.1.0.Final with Hibernate Search - Provider org.hibernate.search.hcore.impl.HibernateSearchIntegrator not found
        pawel.predki

        You are right. I do have the following imports in my project:

         

        import org.apache.solr.analysis.LowerCaseFilterFactory;

        import org.apache.solr.analysis.SnowballPorterFilterFactory;

        import org.apache.solr.analysis.StandardTokenizerFactory;

         

        The question is, how to make my local environment change the version of Hibernate Search to know which libraries to include. As I mentioned before, the Wildfly BOM includes the 4.5.1 version of the library and that's why the automatic imports choose the org.apache.solr package.

         

        I tried changing it manually to:

         

        import org.apache.lucene.analysis.core.LowerCaseFilterFactory;

        import org.apache.lucene.analysis.snowball.SnowballPorterFilterFactory;

        import org.apache.lucene.analysis.standard.StandardTokenizerFactory;

         

        but that is no good, either, since the application won't even compile.

         

        If I add the maven dependency for 5.0.1:

         

        <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-search-orm</artifactId> <version>5.0.1.Final</version> </dependency>

        The library will be packed with my application and will conflict with the library from the upgraded module.

         

        It's probably my lack of experience with maven but I don't know how to fight this problem now.

         

        EDIT:

         

        I'm not sure this is the best way to do it but I finally managed to get the application to deploy. First, I excluded all the hibernate search related dependencies from the Wildfly BOM:

         

        <dependency>
          <groupId>org.wildfly.bom</groupId>
          <artifactId>jboss-javaee-7.0-with-hibernate</artifactId>
          <version>${version.jboss.bom}</version>
          <type>pom</type>
          <scope>import</scope>
          <exclusions>
            <exclusion>  <!-- declare the exclusion here -->
              <groupId>org.hibernate</groupId>
              <artifactId>hibernate-search</artifactId>
            </exclusion>
            <exclusion>  <!-- declare the exclusion here -->
              <groupId>org.hibernate</groupId>
              <artifactId>hibernate-search-analyzers</artifactId>
            </exclusion>
            <exclusion>  <!-- declare the exclusion here -->
              <groupId>org.hibernate</groupId>
              <artifactId>hibernate-search-engine</artifactId>
            </exclusion>
            <exclusion>  <!-- declare the exclusion here -->
              <groupId>org.hibernate</groupId>
              <artifactId>hibernate-search-orm</artifactId>
            </exclusion>
            <exclusion>  <!-- declare the exclusion here -->
              <groupId>org.hibernate</groupId>
              <artifactId>hibernate-search-infinispan</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        

         

        And in my EJB pom I added the dependencies for the new versions:

         

        <dependency>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-analyzers-common</artifactId>
          <version>4.10.3</version>
          <scope>provided</scope>
        </dependency>
        
        <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-search-orm</artifactId>
          <version>5.0.1.Final</version>
          <scope>provided</scope>
        </dependency>
        
        <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-search-engine</artifactId>
          <version>5.0.1.Final</version>
          <scope>provided</scope>
        </dependency>
        

         

        I'm not sure if all the classes have been added correctly but at least the example Getting started with Hibernate Search - Hibernate Search compiles and searches the database.

        1 of 1 people found this helpful
        • 16. Re: Re: Re: Re: Re: Wildfly 8.1.0.Final with Hibernate Search - Provider org.hibernate.search.hcore.impl.HibernateSearchIntegrator not found
          sannegrinovero

          Looks ok. I'm not much of a Maven expert either, and I generally refrain from importing a large bom.

           

          There are probably better ways to define your dependencies, but you can verify if what you have is getting you the right results:

          mvn dependency:tree

          will show you the dependencies you're having on classpath, just make sure you don't have older version of Hibernate Search or Apache Lucene around.

          Also, inspect your deployment to make sure you don't have any Hibernate Search / Lucene related dependency at all, as you'll load them from the modules. Of course if you have additional Analyzers in your deployment that's fine, but make sure they are the ones from the Lucene 4 generation.

          • 17. Re: Re: Re: Re: Re: Wildfly 8.1.0.Final with Hibernate Search - Provider org.hibernate.search.hcore.impl.HibernateSearchIntegrator not found
            pawel.predki

            I went with the bom because I assumed it was designed with the platform we use in mind and everything would work fine. This is true most of the time, until we want to make some upgrades / nontrivial changes. I looked into the dependencies and nothing old is now included.

             

            So now the setup is hopefully done, I can dive into Hibernate Search itself. Looking forward to bugging you on the other forum Thanks again for your help.

            1 2 Previous Next