8 Replies Latest reply on Jan 6, 2017 11:20 AM by seto

    WildFly and Hibernate module problem.

    seto

      https://repo1.maven.org/maven2/org/hibernate/hibernate-orm-modules/5.2.6.Final/hibernate-orm-modules-5.2.6.Final-wildfly…

      I downloaded hibernate module and extracted to modules/system/layers/base.

      <property name="jboss.as.jpa.providerModule" value="org.hibernate:5.2" />
      

      And add this line to persistence-unit to make it use hibernate 5.2 module. Then it reports the exception below.

      Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider org.hibernate.search.hcore.impl.HibernateSearchIntegrator not a subtype

        • 1. Re: WildFly and Hibernate module problem.
          seto

          It seems that it's caused by another line. This line is required for infinispan query. If I don't insert this line. Then the infinispan query and jpa full text search won't work together.

          org.hibernate.search.orm:5.6.0.Beta1 is from infinispan wildfly module.

          <property name="wildfly.jpa.hibernate.search.module" value="org.hibernate.search.orm:5.6.0.Beta1" />
          
          • 2. Re: WildFly and Hibernate module problem.
            seto
            <module name="org.hibernate" slot="5.2" /> 
            

            If I change the modules\system\layers\base\org\hibernate\search\orm\5.6.0.Beta1\modules.xml to add the slot 5.2. Then a new exception is reported.

            Caused by: org.hibernate.cache.CacheException: HHH025011: Infinispan custom cache command factory not installed (possibly because the classloader where Infinispan lives couldn't find the Hibernate Infinispan cache provider)

            • 3. Re: WildFly and Hibernate module problem.
              smarlow

              Which version of WildFly are you trying this with?

              • 4. Re: WildFly and Hibernate module problem.
                seto

                10.1.0.Final with Hibernate ORM module, Infinispan module, Hibernate OGM module, Hibernate Search module installed.

                I'm trying to use the latest Hibernate ORM with Infinispan query.

                So I have to use the below settings to unify the version of Hibernate Search for ORM and Infinispan query

                <property name="wildfly.jpa.hibernate.search.module" value="org.hibernate.search.orm:5.6.0.Beta1" />  
                
                • 5. Re: WildFly and Hibernate module problem.
                  smarlow

                  The Hibernate ORM project testsuite is using WildFly 10.0.0.Final (see https://github.com/hibernate/hibernate-orm/blob/master/libraries.gradle#L25).  Perhaps you should try created a patch for the Hibernate ORM project to use WildFly 10.1.0.Final.

                  • 6. Re: WildFly and Hibernate module problem.
                    seto

                    No. The hibernate itself is working with WildFly 10.1.0.Final well.

                    But the problem is that it didn't work well together with Infinispan wildfly module with query feature.

                    Problems with query module on WildFly.

                    Take a look at the last two posts. It's the compatibility problem between WildFly modules, hibernate orm and infinispan.

                    hibernate orm depends on hibernate search if I use full text query.

                    infinispan depends on hibernate search as well if I use full text query.

                    Then I have to unify the version by settings below.

                    <property name="wildfly.jpa.hibernate.search.module" value="org.hibernate.search.orm:5.6.0.Beta1" />   
                    

                    And I want to use the latest hibernate orm 5.2 jpa provider. So I add the setting below.

                    <property name="jboss.as.jpa.providerModule" value="org.hibernate:5.2" />
                    

                    Then the below exception is thrown.

                    Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider org.hibernate.search.hcore.impl.HibernateSearchIntegrator not a subtype

                    <module name="org.hibernate" slot="5.2" />  
                    

                    Then I change the dependency of hibernate search 5.6.0.Beta1. The new exception below is thrown.

                    Caused by: org.hibernate.cache.CacheException: HHH025011: Infinispan custom cache command factory not installed (possibly because the classloader where Infinispan lives couldn't find the Hibernate Infinispan cache provider)

                    • 7. Re: WildFly and Hibernate module problem.
                      seto

                      I thought that they should work well together. Because they're all from JBoss and run on JBoss Server, WildFly. But they didn't.

                      • 8. Re: WildFly and Hibernate module problem.
                        seto

                        Hibernate Community • View topic - WildFly and Hibernate module problem.

                        The problem is finally resolved by unify the dependency of Hibernater Search to 5.7 for Infinispan Query and JPA/Hibernate ORM 5.2.

                        And also a small change to standalone.xml of WildFly is required if I use second level cache for JPA/Hibernate ORM 5.2.