|
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).
|