Uploaded image for project: 'Hibernate Search'
  1. Hibernate Search
  2. HSEARCH-2029

Hibernate Search does not reuse JavaReflectionManager from Hibernate.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.0.Final
    • Fix Version/s: 5.5.1.Final, 5.6.0.Alpha1
    • Component/s: None
    • Labels:
      None

      Description

      The code in the method SearchConfigurationFromHibernateCore#getReflectionManager() was written for the old Hibernate and does not work anymore with Hibernate 5. The ConfigurationService class from Hibernate does not have the method "getReflectionManager". And therefore the method SearchConfigurationFromHibernateCore#getReflectionManager() falls back to create its own instance of JavaReflectionManager. This leads to higher memory consumption.

      I have prepared a pull request for this issue. But merging the pull request breaks the WildFly integration tests with following message:

      Caused by: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"MemberRegistrationIT.war#primary\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"MemberRegistrationIT.war#primary\": java.lang.LinkageError: loader constraint violation: when resolving interface method \"org.hibernate.boot.spi.MetadataBuildingOptions.getReflectionManager()Lorg/hibernate/annotations/common/reflection/ReflectionManager;\" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/hibernate/search/cfg/impl/SearchConfigurationFromHibernateCore, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for the method's defining class, org/hibernate/boot/spi/MetadataBuildingOptions, have different Class objects for the type org/hibernate/annotations/common/reflection/ReflectionManager used in the signature
         Caused by: java.lang.LinkageError: loader constraint violation: when resolving interface method \"org.hibernate.boot.spi.MetadataBuildingOptions.getReflectionManager()Lorg/hibernate/annotations/common/reflection/ReflectionManager;\" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/hibernate/search/cfg/impl/SearchConfigurationFromHibernateCore, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for the method's defining class, org/hibernate/boot/spi/MetadataBuildingOptions, have different Class objects for the type org/hibernate/annotations/common/reflection/ReflectionManager used in the signatureā€¯}}
      

      To fix this error the definition of the Hibernate module in WildFly must be changed to export the "org.hibernate.commons-annotations" module (s. attached patch for details).

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: